iyoid

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2018 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrIDLimitReached indicates that the max amount of ids has been reached
	ErrIDLimitReached = errors.New("Max amount of iyoids reached for this username and azp")
)

Functions

func InitModels

func InitModels()

InitModels initialize models in mongo, if required.

Types

type Identifier

type Identifier struct {
	Username string   `json:"username"`
	IyoIDs   []string `json:"iyoids"`
	Azp      string   `json:"azp"` // Only this party can see this ID
}

Identifier represents the mapping of an ID to a username, with the azp of the party which is authorized to see it

type Manager

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

Manager represents the database session

func NewManager

func NewManager(r *http.Request) *Manager

NewManager creates and initializes a new Manager

func (*Manager) DeleteForClient

func (m *Manager) DeleteForClient(azp string) error

DeleteForClient deletes all iyoids for a client id

func (*Manager) GetByID

func (m *Manager) GetByID(iyoid string) (*Identifier, error)

GetByID returns the full identifier object for this iyoid

func (*Manager) GetByIDAndAZP

func (m *Manager) GetByIDAndAZP(iyoid, azp string) (*Identifier, error)

GetByIDAndAZP gets an Identifier object by IyoID.

func (*Manager) GetByUsernameAndAZP

func (m *Manager) GetByUsernameAndAZP(username, azp string) (*Identifier, error)

GetByUsernameAndAZP returns the Identifier object for this username and azp combo

func (*Manager) UpsertIdentifier

func (m *Manager) UpsertIdentifier(username, azp, iyoid string) error

UpsertIdentifier adds a new iyoid to a mapping or creates a new mapping

Jump to

Keyboard shortcuts

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