Documentation
¶
Index ¶
- type PostgresDataAccess
- func (da PostgresDataAccess) BundleCreate(bundle data.Bundle) error
- func (da PostgresDataAccess) BundleDelete(name, version string) error
- func (da PostgresDataAccess) BundleDisable(name, version string) error
- func (da PostgresDataAccess) BundleEnable(name, version string) error
- func (da PostgresDataAccess) BundleEnabledVersion(name string) (string, error)
- func (da PostgresDataAccess) BundleExists(name, version string) (bool, error)
- func (da PostgresDataAccess) BundleGet(name, version string) (data.Bundle, error)
- func (da PostgresDataAccess) BundleList() ([]data.Bundle, error)
- func (da PostgresDataAccess) BundleListVersions(name string) ([]data.Bundle, error)
- func (da PostgresDataAccess) BundleUpdate(bundle data.Bundle) error
- func (da PostgresDataAccess) GroupAddUser(groupname string, username string) error
- func (da PostgresDataAccess) GroupCreate(group rest.Group) error
- func (da PostgresDataAccess) GroupDelete(groupname string) error
- func (da PostgresDataAccess) GroupExists(groupname string) (bool, error)
- func (da PostgresDataAccess) GroupGet(groupname string) (rest.Group, error)
- func (da PostgresDataAccess) GroupGrantRole() error
- func (da PostgresDataAccess) GroupList() ([]rest.Group, error)
- func (da PostgresDataAccess) GroupListUsers(groupname string) ([]rest.User, error)
- func (da PostgresDataAccess) GroupRemoveUser(groupname string, username string) error
- func (da PostgresDataAccess) GroupRevokeRole() error
- func (da PostgresDataAccess) GroupUpdate(group rest.Group) error
- func (da PostgresDataAccess) GroupUserAdd(group string, user string) error
- func (da PostgresDataAccess) GroupUserDelete(group string, user string) error
- func (da PostgresDataAccess) GroupUserList(group string) ([]rest.User, error)
- func (da PostgresDataAccess) Initialize() error
- func (da PostgresDataAccess) TokenEvaluate(tokenString string) bool
- func (da PostgresDataAccess) TokenGenerate(username string, duration time.Duration) (rest.Token, error)
- func (da PostgresDataAccess) TokenInvalidate(tokenString string) error
- func (da PostgresDataAccess) TokenRetrieveByToken(tokenString string) (rest.Token, error)
- func (da PostgresDataAccess) TokenRetrieveByUser(username string) (rest.Token, error)
- func (da PostgresDataAccess) UserAuthenticate(username string, password string) (bool, error)
- func (da PostgresDataAccess) UserCreate(user rest.User) error
- func (da PostgresDataAccess) UserDelete(username string) error
- func (da PostgresDataAccess) UserExists(username string) (bool, error)
- func (da PostgresDataAccess) UserGet(username string) (rest.User, error)
- func (da PostgresDataAccess) UserGetByEmail(email string) (rest.User, error)
- func (da PostgresDataAccess) UserGroupAdd(username string, groupname string) error
- func (da PostgresDataAccess) UserGroupDelete(username string, groupname string) error
- func (da PostgresDataAccess) UserGroupList(username string) ([]rest.Group, error)
- func (da PostgresDataAccess) UserList() ([]rest.User, error)
- func (da PostgresDataAccess) UserUpdate(user rest.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostgresDataAccess ¶
type PostgresDataAccess struct {
// contains filtered or unexported fields
}
PostgresDataAccess is a data access implementation backed by a database.
func NewPostgresDataAccess ¶
func NewPostgresDataAccess(configs data.DatabaseConfigs) PostgresDataAccess
NewPostgresDataAccess returns a new PostgresDataAccess based on the supplied config.
func (PostgresDataAccess) BundleCreate ¶
func (da PostgresDataAccess) BundleCreate(bundle data.Bundle) error
BundleCreate TBD
func (PostgresDataAccess) BundleDelete ¶
func (da PostgresDataAccess) BundleDelete(name, version string) error
BundleDelete TBD
func (PostgresDataAccess) BundleDisable ¶
func (da PostgresDataAccess) BundleDisable(name, version string) error
BundleDisable TBD
func (PostgresDataAccess) BundleEnable ¶
func (da PostgresDataAccess) BundleEnable(name, version string) error
BundleEnable TBD
func (PostgresDataAccess) BundleEnabledVersion ¶
func (da PostgresDataAccess) BundleEnabledVersion(name string) (string, error)
BundleEnabledVersion TBD
func (PostgresDataAccess) BundleExists ¶
func (da PostgresDataAccess) BundleExists(name, version string) (bool, error)
BundleExists TBD
func (PostgresDataAccess) BundleGet ¶
func (da PostgresDataAccess) BundleGet(name, version string) (data.Bundle, error)
BundleGet TBD
func (PostgresDataAccess) BundleList ¶
func (da PostgresDataAccess) BundleList() ([]data.Bundle, error)
BundleList TBD
func (PostgresDataAccess) BundleListVersions ¶
func (da PostgresDataAccess) BundleListVersions(name string) ([]data.Bundle, error)
BundleListVersions TBD
func (PostgresDataAccess) BundleUpdate ¶
func (da PostgresDataAccess) BundleUpdate(bundle data.Bundle) error
BundleUpdate TBD
func (PostgresDataAccess) GroupAddUser ¶
func (da PostgresDataAccess) GroupAddUser(groupname string, username string) error
GroupAddUser adds a user to a group
func (PostgresDataAccess) GroupCreate ¶
func (da PostgresDataAccess) GroupCreate(group rest.Group) error
GroupCreate creates a new user group.
func (PostgresDataAccess) GroupDelete ¶
func (da PostgresDataAccess) GroupDelete(groupname string) error
GroupDelete deletes a group.
func (PostgresDataAccess) GroupExists ¶
func (da PostgresDataAccess) GroupExists(groupname string) (bool, error)
GroupExists is used to determine whether a group exists in the data store.
func (PostgresDataAccess) GroupGet ¶
func (da PostgresDataAccess) GroupGet(groupname string) (rest.Group, error)
GroupGet gets a specific group.
func (PostgresDataAccess) GroupGrantRole ¶
func (da PostgresDataAccess) GroupGrantRole() error
GroupGrantRole grants one or more roles to a group.
func (PostgresDataAccess) GroupList ¶
func (da PostgresDataAccess) GroupList() ([]rest.Group, error)
GroupList returns a list of all known groups in the datastore. Passwords are not included. Nice try.
func (PostgresDataAccess) GroupListUsers ¶
func (da PostgresDataAccess) GroupListUsers(groupname string) ([]rest.User, error)
GroupListUsers returns a list of all known users in a group.
func (PostgresDataAccess) GroupRemoveUser ¶
func (da PostgresDataAccess) GroupRemoveUser(groupname string, username string) error
GroupRemoveUser removes a user from a group.
func (PostgresDataAccess) GroupRevokeRole ¶
func (da PostgresDataAccess) GroupRevokeRole() error
GroupRevokeRole revokes a role from a group.
func (PostgresDataAccess) GroupUpdate ¶
func (da PostgresDataAccess) GroupUpdate(group rest.Group) error
GroupUpdate is used to update an existing group. An error is returned if the groupname is empty or if the group doesn't exist. TODO Should we let this create groups that don't exist?
func (PostgresDataAccess) GroupUserAdd ¶
func (da PostgresDataAccess) GroupUserAdd(group string, user string) error
GroupUserAdd comments TBD
func (PostgresDataAccess) GroupUserDelete ¶
func (da PostgresDataAccess) GroupUserDelete(group string, user string) error
GroupUserDelete comments TBD
func (PostgresDataAccess) GroupUserList ¶
func (da PostgresDataAccess) GroupUserList(group string) ([]rest.User, error)
GroupUserList comments TBD
func (PostgresDataAccess) Initialize ¶
func (da PostgresDataAccess) Initialize() error
Initialize sets up the database.
func (PostgresDataAccess) TokenEvaluate ¶
func (da PostgresDataAccess) TokenEvaluate(tokenString string) bool
TokenEvaluate will test a token for validity. It returns true if the token exists and is still within its valid period; false otherwise.
func (PostgresDataAccess) TokenGenerate ¶
func (da PostgresDataAccess) TokenGenerate(username string, duration time.Duration) (rest.Token, error)
TokenGenerate generates a new token for the given user with a specified expiration duration. Any existing token for this user will be automatically invalidated. If the user doesn't exist an error is returned.
func (PostgresDataAccess) TokenInvalidate ¶
func (da PostgresDataAccess) TokenInvalidate(tokenString string) error
TokenInvalidate immediately invalidates the specified token. An error is returned if the token doesn't exist.
func (PostgresDataAccess) TokenRetrieveByToken ¶
func (da PostgresDataAccess) TokenRetrieveByToken(tokenString string) (rest.Token, error)
TokenRetrieveByToken retrieves the token by its value. An error is returned if no such token exists.
func (PostgresDataAccess) TokenRetrieveByUser ¶
func (da PostgresDataAccess) TokenRetrieveByUser(username string) (rest.Token, error)
TokenRetrieveByUser retrieves the token associated with a username. An error is returned if no such token (or user) exists.
func (PostgresDataAccess) UserAuthenticate ¶
func (da PostgresDataAccess) UserAuthenticate(username string, password string) (bool, error)
UserAuthenticate authenticates a username/password combination.
func (PostgresDataAccess) UserCreate ¶
func (da PostgresDataAccess) UserCreate(user rest.User) error
UserCreate is used to create a new Gort user in the data store. An error is returned if the username is empty or if a user already exists.
func (PostgresDataAccess) UserDelete ¶
func (da PostgresDataAccess) UserDelete(username string) error
UserDelete deletes an existing user from the data store. An error is returned if the username parameter is empty or if the user doesn't exist.
func (PostgresDataAccess) UserExists ¶
func (da PostgresDataAccess) UserExists(username string) (bool, error)
UserExists is used to determine whether a Gort user with the given username exists in the data store.
func (PostgresDataAccess) UserGet ¶
func (da PostgresDataAccess) UserGet(username string) (rest.User, error)
UserGet returns a user from the data store. An error is returned if the username parameter is empty or if the user doesn't exist.
func (PostgresDataAccess) UserGetByEmail ¶
func (da PostgresDataAccess) UserGetByEmail(email string) (rest.User, error)
UserGetByEmail returns a user from the data store. An error is returned if the email parameter is empty or if the user doesn't exist.
func (PostgresDataAccess) UserGroupAdd ¶
func (da PostgresDataAccess) UserGroupAdd(username string, groupname string) error
UserGroupAdd comments TBD
func (PostgresDataAccess) UserGroupDelete ¶
func (da PostgresDataAccess) UserGroupDelete(username string, groupname string) error
UserGroupDelete comments TBD
func (PostgresDataAccess) UserGroupList ¶
func (da PostgresDataAccess) UserGroupList(username string) ([]rest.Group, error)
UserGroupList comments TBD
func (PostgresDataAccess) UserList ¶
func (da PostgresDataAccess) UserList() ([]rest.User, error)
UserList returns a list of all known users in the datastore. Passwords are not included. Nice try.
func (PostgresDataAccess) UserUpdate ¶
func (da PostgresDataAccess) UserUpdate(user rest.User) error
UserUpdate is used to update an existing user. An error is returned if the username is empty or if the user doesn't exist.