conf

package
v0.0.0-...-5b94c7c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	Trello      `yaml:"trello"`
	Editor      string `yaml:"editor"`
	Format      string `yaml:"format"`
	NeverPrompt bool   `yaml:"never_prompt"`
}

Conf of the application

func NewConf

func NewConf() *Conf

type FileRepository

type FileRepository struct {
	// contains filtered or unexported fields
}

FileRepository persists the app config on a file system using Viper

func (*FileRepository) Get

func (fr *FileRepository) Get() *Conf

Get the configuration

func (*FileRepository) Init

func (fr *FileRepository) Init() error

Init the configuration with the given flags

func (*FileRepository) Save

func (fr *FileRepository) Save(c *Conf) error

Save the given app config in filesystem

type Provider

type Provider interface {
	Init() error
	Get() *Conf
}

func NewProvider

func NewProvider(r Repository) Provider

type Repository

type Repository interface {
	Init() error
	Get() *Conf
	Save(*Conf) error
}

Repository to persist the app config

func NewFileRepository

func NewFileRepository(file string, v *viper.Viper) Repository

NewFileRepository creates a new FileRepository

type Trello

type Trello struct {
	AppName             string `yaml:"-"`
	ApiKey              string `yaml:"api_key"`
	AccessToken         string `yaml:"access_token"`
	BaseURL             string `yaml:"base_url"`
	TrelloDefaultConfig `yaml:"default_config"`
}

type TrelloDefaultBoard

type TrelloDefaultBoard struct {
	ID   string `yaml:"id"`
	Name string `yaml:"name"`
}

type TrelloDefaultConfig

type TrelloDefaultConfig struct {
	TrelloDefaultBoard `yaml:"board"`
	TrelloDefaultList  `yaml:"list"`
	Labels             []string `yaml:"labels"`
}

type TrelloDefaultList

type TrelloDefaultList struct {
	ID   string `yaml:"id"`
	Name string `yaml:"name"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL