apikey

package
v0.0.0-...-d3d53d6 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2016 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKey

type APIKey struct {
	ID            bson.ObjectId `json:"-" bson:"_id,omitempty"`
	Label         string        `json:"label"`
	Scopes        []string      `json:"scopes"`
	ApplicationID string        `json:"applicationid"`
	ApiKey        string        `json:"apikey"`
	Username      string        `json:"username"`
}

func NewAPIKey

func NewAPIKey(username string, label string) *APIKey

type Manager

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

Manager is used to store users

func NewManager

func NewManager(r *http.Request) *Manager

NewManager creates and initializes a new Manager

func (*Manager) Delete

func (m *Manager) Delete(username string, label string) (err error)

Delete ApplicationAPIKey

func (*Manager) GetByApplicationAndSecret

func (m *Manager) GetByApplicationAndSecret(applicationid string, secret string) (apikey *APIKey, err error)

func (*Manager) GetByUser

func (m *Manager) GetByUser(username string) (apikeys []APIKey, err error)

func (*Manager) GetByUsernameAndLabel

func (m *Manager) GetByUsernameAndLabel(username string, label string) (apikey *APIKey, err error)

func (*Manager) Save

func (m *Manager) Save(apikey *APIKey) (err error)

Save ApplicationAPIKey

Jump to

Keyboard shortcuts

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