Documentation ¶
Index ¶
- func MissingFromFirst[T any](m1 map[string]T, m2 map[string]T) []string
- func SliceToMap(ss []string) map[string]struct{}
- type Backport
- type CanAdminTokens
- type CanPush
- type CanPushNetwork
- type CentralSource
- type Config
- type TLS
- type Token
- type TokenConfig
- type TokenInfo
- type TokenStore
- func (s *TokenStore) AddToken(hash util.TokenHash, info TokenInfo, overwrite bool) (err error)
- func (s *TokenStore) GetTokenByHash(hashString string) (info TokenInfo, ok bool, err error)
- func (s *TokenStore) RemoveToken(hash util.TokenHash) (err error)
- func (s *TokenStore) UpdateToken(info TokenInfo) (err error)
- type TokensConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SliceToMap ¶
Types ¶
type CanAdminTokens ¶
type CanPush ¶
type CanPush struct { Any bool `yaml:"any"` Networks map[string]CanPushNetwork `yaml:"networks"` }
type CanPushNetwork ¶
func (*CanPushNetwork) MarshalYaml ¶
func (c *CanPushNetwork) MarshalYaml() (interface{}, error)
func (*CanPushNetwork) UnmarshalYAML ¶
func (c *CanPushNetwork) UnmarshalYAML(value *yaml.Node) error
type CentralSource ¶
type CentralSource struct { Tokens TokenStore // contains filtered or unexported fields }
func (*CentralSource) AddTokens ¶
func (s *CentralSource) AddTokens(ts []Token) error
func (*CentralSource) ReadBackport ¶
func (s *CentralSource) ReadBackport() error
func (*CentralSource) ReplaceCC ¶
func (s *CentralSource) ReplaceCC(cc *central.Config)
type Config ¶
type Config struct { Addr string `yaml:"addr"` RyoAddr string `yaml:"ryoAddr"` TLS TLS `yaml:"tls"` CC *central.Config `yaml:"central"` Tokens *TokensConfig `yaml:"tokens"` BackportPath string `yaml:"backportPath"` DBPath string `yaml:"dbPath"` }
func LoadConfig ¶
type TokenConfig ¶
type TokenConfig struct { Name string `yaml:"name" json:"name"` Hash *util.TokenHash `yaml:"hash" json:"hash"` Networks map[string]string `yaml:"networks" json:"networks"` CanPull bool `yaml:"canPull"` CanPush *CanPush `yaml:"canPush"` CanAdminTokens *CanAdminTokens `yaml:"canAdminTokens"` CanSRVUpdate bool `yaml:"canSRVUpdate"` SRVAllowances []central.SRVAllowance `yaml:"srvAllowances"` SRVAllowancesAny bool `yaml:"srvAllowancesAny"` }
type TokenInfo ¶
type TokenInfo struct { Name string Networks map[string]string CanPull bool CanPush *CanPush // CanAdminTokens specifies whether this token can add *or remove* tokens. CanAdminTokens *CanAdminTokens // CanSRVUpdate allows updating SRV allowances for peers it can push to. CanSRVUpdate bool // SRVAllowance is a ORed list of SRV alloances for peers it can push to. SRVAllowances []central.SRVAllowance // SRVAllowancesAny allows updating SRV allowances without restrictions by SRVAllowances. SRVAllowancesAny bool Using bool LastUsed time.Time // contains filtered or unexported fields }
type TokenStore ¶
type TokenStore struct {
// contains filtered or unexported fields
}
func (*TokenStore) GetTokenByHash ¶
func (s *TokenStore) GetTokenByHash(hashString string) (info TokenInfo, ok bool, err error)
func (*TokenStore) RemoveToken ¶
func (s *TokenStore) RemoveToken(hash util.TokenHash) (err error)
func (*TokenStore) UpdateToken ¶
func (s *TokenStore) UpdateToken(info TokenInfo) (err error)
type TokensConfig ¶
type TokensConfig struct {
Raw []Token
}
func (*TokensConfig) UnmarshalJSON ¶
func (t *TokensConfig) UnmarshalJSON(data []byte) error
func (*TokensConfig) UnmarshalYAML ¶
func (t *TokensConfig) UnmarshalYAML(value *yaml.Node) error
Click to show internal directories.
Click to hide internal directories.