Documentation
¶
Overview ¶
Package admin defines and implements store for admin-level data like secret key, list of admins and so on
Index ¶
- type EventType
- type RPC
- type StaticStore
- func (s *StaticStore) Admins(string) (ids []string, err error)
- func (s *StaticStore) Email(string) (email string, err error)
- func (s *StaticStore) Enabled(site string) (ok bool, err error)
- func (s *StaticStore) Key() (key string, err error)
- func (s *StaticStore) OnEvent(siteID string, et EventType) error
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RPC ¶ added in v1.4.0
RPC implements remote engine and delegates all Calls to remote http server
type StaticStore ¶
type StaticStore struct {
// contains filtered or unexported fields
}
StaticStore implements keys.Store with a single set of admins and email for all sites
func NewStaticKeyStore ¶
func NewStaticKeyStore(key string) *StaticStore
NewStaticKeyStore is a shortcut for making StaticStore for key consumers only
func NewStaticStore ¶
func NewStaticStore(key string, sites []string, admins []string, email string) *StaticStore
NewStaticStore makes StaticStore instance with given key
func (*StaticStore) Admins ¶
func (s *StaticStore) Admins(string) (ids []string, err error)
Admins returns static list of admin's ids, the same for all sites
func (*StaticStore) Email ¶
func (s *StaticStore) Email(string) (email string, err error)
Email gets static email address
func (*StaticStore) Enabled ¶ added in v1.5.0
func (s *StaticStore) Enabled(site string) (ok bool, err error)
Enabled if always true for StaticStore
func (*StaticStore) Key ¶
func (s *StaticStore) Key() (key string, err error)
Key returns static key, same for all sites
type Store ¶
type Store interface { Key() (key string, err error) Admins(siteID string) (ids []string, err error) Email(siteID string) (email string, err error) Enabled(siteID string) (ok bool, err error) OnEvent(siteID string, et EventType) error }
Store defines interface returning admins info for given site