Documentation ¶
Index ¶
- type Config
- type RelayState
- func (config *RelayState) AddSubscription(domain Subscription)
- func (config *RelayState) DelSubscription(domain string)
- func (config *RelayState) Load()
- func (config *RelayState) SelectSubscription(domain string) *Subscription
- func (config *RelayState) SetBlockedDomain(domain string, value bool)
- func (config *RelayState) SetConfig(key Config, value bool)
- func (config *RelayState) SetLimitedDomain(domain string, value bool)
- type Subscription
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RelayState ¶
type RelayState struct { RedisClient *redis.Client RelayConfig relayConfig `json:"relayConfig"` LimitedDomains []string `json:"limitedDomains"` BlockedDomains []string `json:"blockedDomains"` Subscriptions []Subscription `json:"subscriptions"` }
RelayState : Store subscriptions and relay configrations
func NewState ¶
func NewState(redisClient *redis.Client) RelayState
NewState : Create new RelayState instance with redis client
func (*RelayState) AddSubscription ¶
func (config *RelayState) AddSubscription(domain Subscription)
AddSubscription : Add new instance for subscription list
func (*RelayState) DelSubscription ¶
func (config *RelayState) DelSubscription(domain string)
DelSubscription : Delete instance from subscription list
func (*RelayState) SelectSubscription ¶ added in v0.2.1
func (config *RelayState) SelectSubscription(domain string) *Subscription
SelectSubscription : Select instance from string
func (*RelayState) SetBlockedDomain ¶
func (config *RelayState) SetBlockedDomain(domain string, value bool)
SetBlockedDomain : Set/Unset instance for blocked domain
func (*RelayState) SetConfig ¶
func (config *RelayState) SetConfig(key Config, value bool)
SetConfig : Set relay configration
func (*RelayState) SetLimitedDomain ¶
func (config *RelayState) SetLimitedDomain(domain string, value bool)
SetLimitedDomain : Set/Unset instance for limited domain
Click to show internal directories.
Click to hide internal directories.