Documentation ¶
Index ¶
- Constants
- Variables
- func Setup() error
- type AuthConfig
- type AuthConfigUpdate
- type Config
- func (c *Config) GetAuth() *AuthConfig
- func (c *Config) GetTransfer() *TransferConfig
- func (c *Config) JoinConfigDir(name string) string
- func (c *Config) JoinDebugDir(name string) string
- func (c *Config) JoinLibDir(name string) string
- func (c *Config) JoinLogDir(name string) string
- func (c *Config) UpdateAuth(u *AuthConfigUpdate) (*AuthConfig, state.Error)
- func (c *Config) UpdateTransfer(u *TransferConfigUpdate) (*TransferConfig, state.Error)
- type TransferConfig
- type TransferConfigUpdate
- type TransferPath
Constants ¶
View Source
const APP_NAME string = "fson"
Variables ¶
View Source
var (
ErrConfigNotInit = errors.New("config not initialized yet")
)
Functions ¶
Types ¶
type AuthConfig ¶
type AuthConfig struct { UpdatedAt time.Time `json:"updatedAt"` CreatedAt time.Time `json:"createdAt"` TokensExpiresAfter time.Duration `json:"tokensExpiresAfter"` TokenExpireTolerant time.Duration `json:"tokenExpireTolerant"` Secret string `json:"secret"` AdminSecret string `json:"adminSecret"` // contains filtered or unexported fields }
func (*AuthConfig) FilePath ¶
func (ac *AuthConfig) FilePath() string
func (*AuthConfig) UpdateFrom ¶
func (ac *AuthConfig) UpdateFrom(uc *AuthConfigUpdate) *AuthConfig
Updates current config with given config update. Updates config if values are not same.
type AuthConfigUpdate ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config struct is designed to manipule how this applications works.
func (*Config) JoinConfigDir ¶
func (*Config) JoinDebugDir ¶
func (*Config) JoinLibDir ¶
func (*Config) JoinLogDir ¶
func (*Config) UpdateAuth ¶
func (c *Config) UpdateAuth(u *AuthConfigUpdate) (*AuthConfig, state.Error)
If pointer to update is nil return State with StatusFailUpdate.
func (*Config) UpdateTransfer ¶
func (c *Config) UpdateTransfer(u *TransferConfigUpdate) (*TransferConfig, state.Error)
If pointer to update is nil return State with StatusFailUpdate.
type TransferConfig ¶
type TransferConfig struct { UpdatedAt time.Time `json:"updatedAt"` CreatedAt time.Time `json:"createdAt"` AutoStart bool `json:"autoStart"` UploadDir string `json:"uploadDir"` TempDir string `json:"tempDir"` Transfer []TransferPath `json:"transfer"` // contains filtered or unexported fields }
func (*TransferConfig) FilePath ¶
func (tc *TransferConfig) FilePath() string
func (*TransferConfig) UpdateFrom ¶
func (tc *TransferConfig) UpdateFrom(uc *TransferConfigUpdate) *TransferConfig
type TransferConfigUpdate ¶
type TransferConfigUpdate struct { AutoStart *bool `json:"autoStart"` UploadDir *string `json:"uploadDir"` TempDir *string `json:"tempDir"` Transfer *[]TransferPath `json:"transfer"` }
type TransferPath ¶
Click to show internal directories.
Click to hide internal directories.