Documentation
¶
Index ¶
- Constants
- type PostgresDataAccess
- func (da PostgresDataAccess) BundleCreate(ctx context.Context, bundle data.Bundle) error
- func (da PostgresDataAccess) BundleDelete(ctx context.Context, name, version string) error
- func (da PostgresDataAccess) BundleDisable(ctx context.Context, name string) error
- func (da PostgresDataAccess) BundleEnable(ctx context.Context, name, version string) error
- func (da PostgresDataAccess) BundleEnabledVersion(ctx context.Context, name string) (string, error)
- func (da PostgresDataAccess) BundleExists(ctx context.Context, name, version string) (bool, error)
- func (da PostgresDataAccess) BundleGet(ctx context.Context, name, version string) (data.Bundle, error)
- func (da PostgresDataAccess) BundleList(ctx context.Context) ([]data.Bundle, error)
- func (da PostgresDataAccess) BundleListVersions(ctx context.Context, name string) ([]data.Bundle, error)
- func (da PostgresDataAccess) BundleUpdate(ctx context.Context, bundle data.Bundle) error
- func (da PostgresDataAccess) FindCommandEntry(ctx context.Context, bundleName, commandName string) ([]data.CommandEntry, error)
- func (da PostgresDataAccess) GroupAddUser(ctx context.Context, groupname string, username string) error
- func (da PostgresDataAccess) GroupCreate(ctx context.Context, group rest.Group) error
- func (da PostgresDataAccess) GroupDelete(ctx context.Context, groupname string) error
- func (da PostgresDataAccess) GroupExists(ctx context.Context, groupname string) (bool, error)
- func (da PostgresDataAccess) GroupGet(ctx context.Context, groupname string) (rest.Group, error)
- func (da PostgresDataAccess) GroupGrantRole(ctx context.Context) error
- func (da PostgresDataAccess) GroupList(ctx context.Context) ([]rest.Group, error)
- func (da PostgresDataAccess) GroupListUsers(ctx context.Context, groupname string) ([]rest.User, error)
- func (da PostgresDataAccess) GroupRemoveUser(ctx context.Context, groupname string, username string) error
- func (da PostgresDataAccess) GroupRevokeRole(ctx context.Context) error
- func (da PostgresDataAccess) GroupUpdate(ctx context.Context, group rest.Group) error
- func (da PostgresDataAccess) GroupUserAdd(ctx context.Context, group string, user string) error
- func (da PostgresDataAccess) GroupUserDelete(ctx context.Context, group string, user string) error
- func (da PostgresDataAccess) GroupUserList(ctx context.Context, group string) ([]rest.User, error)
- func (da PostgresDataAccess) Initialize(ctx context.Context) error
- func (da PostgresDataAccess) RequestBegin(ctx context.Context, req *data.CommandRequest) error
- func (da PostgresDataAccess) RequestClose(ctx context.Context, res data.CommandResponse) error
- func (da PostgresDataAccess) RequestUpdate(ctx context.Context, req data.CommandRequest) error
- func (da PostgresDataAccess) TokenEvaluate(ctx context.Context, tokenString string) bool
- func (da PostgresDataAccess) TokenGenerate(ctx context.Context, username string, duration time.Duration) (rest.Token, error)
- func (da PostgresDataAccess) TokenInvalidate(ctx context.Context, tokenString string) error
- func (da PostgresDataAccess) TokenRetrieveByToken(ctx context.Context, tokenString string) (rest.Token, error)
- func (da PostgresDataAccess) TokenRetrieveByUser(ctx context.Context, username string) (rest.Token, error)
- func (da PostgresDataAccess) UserAuthenticate(ctx context.Context, username string, password string) (bool, error)
- func (da PostgresDataAccess) UserCreate(ctx context.Context, user rest.User) error
- func (da PostgresDataAccess) UserDelete(ctx context.Context, username string) error
- func (da PostgresDataAccess) UserExists(ctx context.Context, username string) (bool, error)
- func (da PostgresDataAccess) UserGet(ctx context.Context, username string) (rest.User, error)
- func (da PostgresDataAccess) UserGetByEmail(ctx context.Context, email string) (rest.User, error)
- func (da PostgresDataAccess) UserGroupAdd(ctx context.Context, username string, groupname string) error
- func (da PostgresDataAccess) UserGroupDelete(ctx context.Context, username string, groupname string) error
- func (da PostgresDataAccess) UserGroupList(ctx context.Context, username string) ([]rest.Group, error)
- func (da PostgresDataAccess) UserList(ctx context.Context) ([]rest.User, error)
- func (da PostgresDataAccess) UserUpdate(ctx context.Context, user rest.User) error
Constants ¶
const (
DatabaseGort = "gort"
)
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 ¶
BundleCreate TBD
func (PostgresDataAccess) BundleDelete ¶
func (da PostgresDataAccess) BundleDelete(ctx context.Context, name, version string) error
BundleDelete TBD
func (PostgresDataAccess) BundleDisable ¶
func (da PostgresDataAccess) BundleDisable(ctx context.Context, name string) error
BundleDisable TBD
func (PostgresDataAccess) BundleEnable ¶
func (da PostgresDataAccess) BundleEnable(ctx context.Context, name, version string) error
BundleEnable TBD
func (PostgresDataAccess) BundleEnabledVersion ¶
BundleEnabledVersion TBD
func (PostgresDataAccess) BundleExists ¶
BundleExists TBD
func (PostgresDataAccess) BundleGet ¶
func (da PostgresDataAccess) BundleGet(ctx context.Context, name, version string) (data.Bundle, error)
BundleGet TBD
func (PostgresDataAccess) BundleList ¶
BundleList TBD
func (PostgresDataAccess) BundleListVersions ¶
func (da PostgresDataAccess) BundleListVersions(ctx context.Context, name string) ([]data.Bundle, error)
BundleListVersions TBD
func (PostgresDataAccess) BundleUpdate ¶
BundleUpdate TBD
func (PostgresDataAccess) FindCommandEntry ¶
func (da PostgresDataAccess) FindCommandEntry(ctx context.Context, bundleName, commandName string) ([]data.CommandEntry, error)
FindCommandEntry is used to find the enabled commands with the provided bundle and command names. If either is empty, it is treated as a wildcard. Importantly, this must only return ENABLED commands!
func (PostgresDataAccess) GroupAddUser ¶
func (da PostgresDataAccess) GroupAddUser(ctx context.Context, groupname string, username string) error
GroupAddUser adds a user to a group
func (PostgresDataAccess) GroupCreate ¶
GroupCreate creates a new user group.
func (PostgresDataAccess) GroupDelete ¶
func (da PostgresDataAccess) GroupDelete(ctx context.Context, groupname string) error
GroupDelete deletes a group.
func (PostgresDataAccess) GroupExists ¶
GroupExists is used to determine whether a group exists in the data store.
func (PostgresDataAccess) GroupGrantRole ¶
func (da PostgresDataAccess) GroupGrantRole(ctx context.Context) error
GroupGrantRole grants one or more roles to a group.
func (PostgresDataAccess) GroupList ¶
GroupList returns a list of all known groups in the datastore. Passwords are not included. Nice try.
func (PostgresDataAccess) GroupListUsers ¶
func (da PostgresDataAccess) GroupListUsers(ctx context.Context, groupname string) ([]rest.User, error)
GroupListUsers returns a list of all known users in a group.
func (PostgresDataAccess) GroupRemoveUser ¶
func (da PostgresDataAccess) GroupRemoveUser(ctx context.Context, groupname string, username string) error
GroupRemoveUser removes a user from a group.
func (PostgresDataAccess) GroupRevokeRole ¶
func (da PostgresDataAccess) GroupRevokeRole(ctx context.Context) error
GroupRevokeRole revokes a role from a group.
func (PostgresDataAccess) GroupUpdate ¶
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 ¶
GroupUserAdd comments TBD
func (PostgresDataAccess) GroupUserDelete ¶
GroupUserDelete comments TBD
func (PostgresDataAccess) GroupUserList ¶
GroupUserList comments TBD
func (PostgresDataAccess) Initialize ¶
func (da PostgresDataAccess) Initialize(ctx context.Context) error
Initialize sets up the database.
func (PostgresDataAccess) RequestBegin ¶
func (da PostgresDataAccess) RequestBegin(ctx context.Context, req *data.CommandRequest) error
func (PostgresDataAccess) RequestClose ¶
func (da PostgresDataAccess) RequestClose(ctx context.Context, res data.CommandResponse) error
func (PostgresDataAccess) RequestUpdate ¶
func (da PostgresDataAccess) RequestUpdate(ctx context.Context, req data.CommandRequest) error
func (PostgresDataAccess) TokenEvaluate ¶
func (da PostgresDataAccess) TokenEvaluate(ctx context.Context, 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(ctx context.Context, 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(ctx context.Context, 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(ctx context.Context, 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(ctx context.Context, 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(ctx context.Context, username string, password string) (bool, error)
UserAuthenticate authenticates a username/password combination.
func (PostgresDataAccess) UserCreate ¶
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(ctx context.Context, 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 ¶
UserExists is used to determine whether a Gort user with the given username exists in the data store.
func (PostgresDataAccess) UserGet ¶
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 ¶
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(ctx context.Context, username string, groupname string) error
UserGroupAdd comments TBD
func (PostgresDataAccess) UserGroupDelete ¶
func (da PostgresDataAccess) UserGroupDelete(ctx context.Context, username string, groupname string) error
UserGroupDelete comments TBD
func (PostgresDataAccess) UserGroupList ¶
func (da PostgresDataAccess) UserGroupList(ctx context.Context, username string) ([]rest.Group, error)
UserGroupList comments TBD
func (PostgresDataAccess) UserList ¶
UserList returns a list of all known users in the datastore. Passwords are not included. Nice try.
func (PostgresDataAccess) UserUpdate ¶
UserUpdate is used to update an existing user. An error is returned if the username is empty or if the user doesn't exist.