administrator

package
v0.15.16-rc7 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAdminLimit = 20

DefaultAdminLimit is the default limit for listing provisioners.

View Source
const DefaultAdminMax = 100

DefaultAdminMax is the maximum limit for listing provisioners.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

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

Collection is a memory map of admins.

func NewCollection

func NewCollection(provisioners *provisioner.Collection) *Collection

NewCollection initializes a collection of provisioners. The given list of audiences are the audiences used by the JWT provisioner.

func (*Collection) Find

func (c *Collection) Find(cursor string, limit int) ([]*linkedca.Admin, string)

Find implements pagination on a list of sorted admins.

func (*Collection) LoadByID

func (c *Collection) LoadByID(id string) (*linkedca.Admin, bool)

LoadByID a admin by the ID.

func (*Collection) LoadByProvisioner

func (c *Collection) LoadByProvisioner(provName string) ([]*linkedca.Admin, bool)

LoadByProvisioner a admin by the subject and provisioner name.

func (*Collection) LoadBySubProv

func (c *Collection) LoadBySubProv(sub, provName string) (*linkedca.Admin, bool)

LoadBySubProv a admin by the subject and provisioner name.

func (*Collection) Remove

func (c *Collection) Remove(id string) error

Remove deletes an admin from all associated collections and lists.

func (*Collection) Store

func (c *Collection) Store(adm *linkedca.Admin, prov provisioner.Interface) error

Store adds an admin to the collection and enforces the uniqueness of admin IDs and amdin subject <-> provisioner name combos.

func (*Collection) SuperCount

func (c *Collection) SuperCount() int

SuperCount returns the total number of admins.

func (*Collection) SuperCountByProvisioner

func (c *Collection) SuperCountByProvisioner(provName string) int

SuperCountByProvisioner returns the total number of admins.

func (*Collection) Update

func (c *Collection) Update(id string, nu *linkedca.Admin) (*linkedca.Admin, error)

Update updates the given admin in all related lists and collections.

Jump to

Keyboard shortcuts

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