memory

package
v0.4.8-dev.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryDataAccess

type InMemoryDataAccess struct {
	// contains filtered or unexported fields
}

InMemoryDataAccess is an entirely in-memory representation of a data access layer. Great for testing and development. Terrible for production.

func NewInMemoryDataAccess

func NewInMemoryDataAccess() *InMemoryDataAccess

NewInMemoryDataAccess returns a new InMemoryDataAccess instance.

func (*InMemoryDataAccess) BundleCreate

func (da *InMemoryDataAccess) BundleCreate(bundle data.Bundle) error

BundleCreate TBD

func (*InMemoryDataAccess) BundleDelete

func (da *InMemoryDataAccess) BundleDelete(name, version string) error

BundleDelete TBD

func (*InMemoryDataAccess) BundleDisable

func (da *InMemoryDataAccess) BundleDisable(name string) error

BundleDisable TBD

func (*InMemoryDataAccess) BundleEnable

func (da *InMemoryDataAccess) BundleEnable(name, version string) error

BundleEnable TBD

func (*InMemoryDataAccess) BundleEnabledVersion

func (da *InMemoryDataAccess) BundleEnabledVersion(name string) (string, error)

BundleEnabledVersion TBD

func (*InMemoryDataAccess) BundleExists

func (da *InMemoryDataAccess) BundleExists(name, version string) (bool, error)

BundleExists TBD

func (*InMemoryDataAccess) BundleGet

func (da *InMemoryDataAccess) BundleGet(name, version string) (data.Bundle, error)

BundleGet TBD

func (*InMemoryDataAccess) BundleList

func (da *InMemoryDataAccess) BundleList() ([]data.Bundle, error)

BundleList TBD

func (*InMemoryDataAccess) BundleListVersions

func (da *InMemoryDataAccess) BundleListVersions(name string) ([]data.Bundle, error)

BundleListVersions TBD

func (*InMemoryDataAccess) BundleUpdate

func (da *InMemoryDataAccess) BundleUpdate(bundle data.Bundle) error

BundleUpdate TBD

func (*InMemoryDataAccess) FindCommandEntry

func (da *InMemoryDataAccess) FindCommandEntry(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 (*InMemoryDataAccess) GroupAddUser

func (da *InMemoryDataAccess) GroupAddUser(groupname string, username string) error

GroupAddUser adds a user to a group

func (*InMemoryDataAccess) GroupCreate

func (da *InMemoryDataAccess) GroupCreate(group rest.Group) error

GroupCreate creates a new user group.

func (*InMemoryDataAccess) GroupDelete

func (da *InMemoryDataAccess) GroupDelete(groupname string) error

GroupDelete delete a group.

func (*InMemoryDataAccess) GroupExists

func (da *InMemoryDataAccess) GroupExists(groupname string) (bool, error)

GroupExists is used to determine whether a group exists in the data store.

func (*InMemoryDataAccess) GroupGet

func (da *InMemoryDataAccess) GroupGet(groupname string) (rest.Group, error)

GroupGet gets a specific group.

func (*InMemoryDataAccess) GroupGrantRole

func (da *InMemoryDataAccess) GroupGrantRole() error

GroupGrantRole grants one or more roles to a group.

func (*InMemoryDataAccess) GroupList

func (da *InMemoryDataAccess) GroupList() ([]rest.Group, error)

GroupList returns a list of all known groups in the datastore. Passwords are not included. Nice try.

func (*InMemoryDataAccess) GroupRemoveUser

func (da *InMemoryDataAccess) GroupRemoveUser(groupname string, username string) error

GroupRemoveUser removes one or more users from a group.

func (*InMemoryDataAccess) GroupRevokeRole

func (da *InMemoryDataAccess) GroupRevokeRole() error

GroupRevokeRole revokes one or more roles from a group.

func (*InMemoryDataAccess) GroupUpdate

func (da *InMemoryDataAccess) 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 (*InMemoryDataAccess) GroupUserAdd

func (da *InMemoryDataAccess) GroupUserAdd(group string, user string) error

GroupUserAdd comments TBD

func (*InMemoryDataAccess) GroupUserDelete

func (da *InMemoryDataAccess) GroupUserDelete(group string, user string) error

GroupUserDelete comments TBD

func (*InMemoryDataAccess) GroupUserList

func (da *InMemoryDataAccess) GroupUserList(group string) ([]rest.User, error)

GroupUserList comments TBD

func (*InMemoryDataAccess) Initialize

func (da *InMemoryDataAccess) Initialize() error

Initialize initializes an InMemoryDataAccess instance.

func (*InMemoryDataAccess) TokenEvaluate

func (da *InMemoryDataAccess) 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 (*InMemoryDataAccess) TokenGenerate

func (da *InMemoryDataAccess) 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 (*InMemoryDataAccess) TokenInvalidate

func (da *InMemoryDataAccess) TokenInvalidate(tokenString string) error

TokenInvalidate immediately invalidates the specified token. An error is returned if the token doesn't exist.

func (*InMemoryDataAccess) TokenRetrieveByToken

func (da *InMemoryDataAccess) TokenRetrieveByToken(tokenString string) (rest.Token, error)

TokenRetrieveByToken retrieves the token by its value. An error is returned if no such token exists.

func (*InMemoryDataAccess) TokenRetrieveByUser

func (da *InMemoryDataAccess) 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 (*InMemoryDataAccess) UserAuthenticate

func (da *InMemoryDataAccess) UserAuthenticate(username string, password string) (bool, error)

UserAuthenticate authenticates a username/password combination.

func (*InMemoryDataAccess) UserCreate

func (da *InMemoryDataAccess) 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 (*InMemoryDataAccess) UserDelete

func (da *InMemoryDataAccess) UserDelete(username string) error

UserDelete deletes an existing user from the data store. An error is returned if the username parameter is empty of if the user doesn't exist.

func (*InMemoryDataAccess) UserExists

func (da *InMemoryDataAccess) UserExists(username string) (bool, error)

UserExists is used to determine whether a Gort user with the given username exists in the data store.

func (*InMemoryDataAccess) UserGet

func (da *InMemoryDataAccess) 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 (*InMemoryDataAccess) UserGetByEmail

func (da *InMemoryDataAccess) 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 (*InMemoryDataAccess) UserGroupAdd

func (da *InMemoryDataAccess) UserGroupAdd(user string, group string) error

UserGroupAdd comments TBD

func (*InMemoryDataAccess) UserGroupDelete

func (da *InMemoryDataAccess) UserGroupDelete(user string, group string) error

UserGroupDelete comments TBD

func (*InMemoryDataAccess) UserGroupList

func (da *InMemoryDataAccess) UserGroupList(user string) ([]rest.Group, error)

UserGroupList comments TBD

func (*InMemoryDataAccess) UserList

func (da *InMemoryDataAccess) UserList() ([]rest.User, error)

UserList returns a list of all known users in the datastore. Passwords are not included. Nice try.

func (*InMemoryDataAccess) UserUpdate

func (da *InMemoryDataAccess) 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. TODO Should we let this create users that don't exist?

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL