Documentation ¶
Overview ¶
Package admin defines and implements store for admin-level data like secret key, list of admins and so on
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoStore ¶
type MongoStore struct {
// contains filtered or unexported fields
}
MongoStore implements admin.Store with mongo backend
func NewMongoStore ¶
func NewMongoStore(conn *mongo.Connection, key string) *MongoStore
NewMongoStore makes admin Store for mongo's connection
func (*MongoStore) Admins ¶
func (m *MongoStore) Admins(siteID string) (ids []string)
Admins executes find by siteID and returns admins ids
func (*MongoStore) Email ¶
func (m *MongoStore) Email(siteID string) (email string)
Email executes find by siteID and returns admin's email
func (*MongoStore) Key ¶
func (m *MongoStore) Key() (key string, err error)
Key executes find by siteID and returns substructure with secret key
type StaticStore ¶
type StaticStore struct {
// contains filtered or unexported fields
}
StaticStore implements keys.Store with a single, predefined key
func NewStaticKeyStore ¶
func NewStaticKeyStore(key string) *StaticStore
NewStaticKeyStore is a shortcut for making StaticStore for key consumers only
func NewStaticStore ¶
func NewStaticStore(key string, admins []string, email string) *StaticStore
NewStaticStore makes StaticStore instance with given key
func (*StaticStore) Admins ¶
func (s *StaticStore) Admins(string) (ids []string)
Admins returns static list of admin's ids, the same for all sites
func (*StaticStore) Email ¶
func (s *StaticStore) Email(string) (email string)
Email gets static email address
func (*StaticStore) Key ¶
func (s *StaticStore) Key() (key string, err error)
Key returns static key for all sites, allows empty site