Documentation ¶
Index ¶
- Constants
- type Collection
- func (c *Collection) Find(cursor string, limit int) ([]*linkedca.Admin, string)
- func (c *Collection) LoadByID(id string) (*linkedca.Admin, bool)
- func (c *Collection) LoadByProvisioner(provName string) ([]*linkedca.Admin, bool)
- func (c *Collection) LoadBySubProv(sub, provName string) (*linkedca.Admin, bool)
- func (c *Collection) Remove(id string) error
- func (c *Collection) Store(adm *linkedca.Admin, prov provisioner.Interface) error
- func (c *Collection) SuperCount() int
- func (c *Collection) SuperCountByProvisioner(provName string) int
- func (c *Collection) Update(id string, nu *linkedca.Admin) (*linkedca.Admin, error)
Constants ¶
const DefaultAdminLimit = 20
DefaultAdminLimit is the default limit for listing provisioners.
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) 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.