Documentation ¶
Index ¶
- Variables
- func InitModels()
- type Manager
- func (m *Manager) DeleteRegistryEntry(username string, globalid string, key string) (err error)
- func (m *Manager) GetRegistryEntry(username string, globalid string, key string) (registryEntry *RegistryEntry, err error)
- func (m *Manager) ListRegistryEntries(username string, globalid string) (registryEntries []RegistryEntry, err error)
- func (m *Manager) UpsertRegistryEntry(username string, globalid string, registryEntry RegistryEntry) (err error)
- type RegistryEntry
Constants ¶
This section is empty.
Variables ¶
var ErrUsernameAndGlobalIDAreMutuallyExclusive = errors.New("Username and globalid can not both be specified")
ErrUsernameAndGlobalIDAreMutuallyExclusive is the error given when both a username and a globalid were given
var ErrUsernameOrGlobalIDRequired = errors.New("Username or globalid is required")
ErrUsernameOrGlobalIDRequired is used to indicate that no username of globalid were specified
Functions ¶
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is used to store KeyValuePairs in a user or organization registry
func NewManager ¶
NewManager creates and initializes a new Manager
func (*Manager) DeleteRegistryEntry ¶
DeleteRegistryEntry deletes a registry entry Either a username or a globalid needs to be given If the key does not exist, no error is returned
func (*Manager) GetRegistryEntry ¶
func (m *Manager) GetRegistryEntry(username string, globalid string, key string) (registryEntry *RegistryEntry, err error)
GetRegistryEntry gets a registryentry for a user or organization If no such entry exists, nil is returned, both for the registryEntry and error
func (*Manager) ListRegistryEntries ¶
func (m *Manager) ListRegistryEntries(username string, globalid string) (registryEntries []RegistryEntry, err error)
ListRegistryEntries gets all registry entries for a user or organization
func (*Manager) UpsertRegistryEntry ¶
func (m *Manager) UpsertRegistryEntry(username string, globalid string, registryEntry RegistryEntry) (err error)
UpsertRegistryEntry updates or inserts a registry entry Either a username or a globalid needs to be given
type RegistryEntry ¶
type RegistryEntry struct { Key string `json:"Key" validate:"min=1,max=256,nonzero"` Value string `json:"Value" validate:"max=1024,nonzero"` }
RegistryEntry is a key-pair in a user or organization registry
func (RegistryEntry) Validate ¶
func (s RegistryEntry) Validate() error
Validate checks if the RegistryEntry is valid