Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DataAccess ¶
type DataAccess interface {
Initialize() error
BundleCreate(bundle data.Bundle) error
BundleDelete(name string, version string) error
BundleDisable(name string, version string) error
BundleEnable(name string, version string) error
BundleEnabledVersion(name string) (string, error)
BundleExists(name string, version string) (bool, error)
BundleGet(name string, version string) (data.Bundle, error)
BundleList() ([]data.Bundle, error)
BundleListVersions(name string) ([]data.Bundle, error)
BundleUpdate(bundle data.Bundle) error
GroupAddUser(groupname string, username string) error
GroupCreate(group rest.Group) error
GroupDelete(groupname string) error
GroupExists(groupname string) (bool, error)
GroupGet(groupname string) (rest.Group, error)
GroupGrantRole() error
GroupList() ([]rest.Group, error)
GroupRemoveUser(groupname string, username string) error
GroupRevokeRole() error
GroupUpdate(rest.Group) error
GroupUserList(groupname string) ([]rest.User, error)
GroupUserAdd(groupname string, user string) error
GroupUserDelete(groupname string, username string) error
TokenEvaluate(token string) bool
TokenGenerate(username string, duration time.Duration) (rest.Token, error)
TokenInvalidate(token string) error
TokenRetrieveByUser(username string) (rest.Token, error)
TokenRetrieveByToken(token string) (rest.Token, error)
UserAuthenticate(username string, password string) (bool, error)
UserCreate(user rest.User) error
UserDelete(username string) error
UserExists(username string) (bool, error)
UserGet(username string) (rest.User, error)
UserGetByEmail(email string) (rest.User, error)
UserGroupList(username string) ([]rest.Group, error)
UserGroupAdd(username string, groupname string) error
UserGroupDelete(username string, groupname string) error
UserList() ([]rest.User, error)
UserUpdate(user rest.User) error
}
DataAccess represents a common DataAccessObject, backed either by a database or an in-memory datastore.
func Get ¶
func Get() (DataAccess, error)
Get provides an interface to the data access layer. If the state is not 'initialized', this will return an error.
type State ¶
type State byte
State represents a possible state of the data access layer.
const ( // StateUninitialized is the default state of the data access // layer, before initializtion begins. StateUninitialized State = iota // StateInitializing indicates that the data access layer is // initializing, either because it's new or because something has // changed (config updated, database disconnected, etc) StateInitializing // StateInitialized indicates the data access layer is fully // initialized and (presumably) functional. StateInitialized // StateError indicated that some kind of error is preventing the // data access layer from initializing correctly. StateError )
func CurrentState ¶
func CurrentState() State
CurrentState returns the current state of the data access layer.
Click to show internal directories.
Click to hide internal directories.