config

package
v0.0.0-...-33f656b Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalFileConfig

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

LocalFileConfig implement the WeChatConfigurator by local file system

func (*LocalFileConfig) GetConfig

func (l *LocalFileConfig) GetConfig() *WeChatConfig

GetConfig just return exists config object

func (*LocalFileConfig) LoadConfig

func (l *LocalFileConfig) LoadConfig(configFile string) (
	cfg *WeChatConfig, err error)

LoadConfig load config from the file

func (*LocalFileConfig) SaveConfig

func (l *LocalFileConfig) SaveConfig() (err error)

SaveConfig save the config into local file

type WeChatConfig

type WeChatConfig struct {
	GitURL              string `yaml:"git_url"`
	GitBranch           string `yaml:"git_branch"`
	GitHubWebHookSecret string `yaml:"github_webhook_secret"`

	ServerPort int `yaml:"server_port"`

	AppID     string `yaml:"appID"`
	AppSecret string `yaml:"appSecret"`
	Token     string `yaml:"token"`

	Valid bool `yaml:"valid"`
}

WeChatConfig represents WeChat config

func NewConfig

func NewConfig() *WeChatConfig

NewConfig new config instance

type WeChatConfigurator

type WeChatConfigurator interface {
	LoadConfig(string) (*WeChatConfig, error)
	GetConfig() *WeChatConfig
	SaveConfig() error
}

WeChatConfigurator represent the spec for configuration reader

Jump to

Keyboard shortcuts

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