adapters

package
v0.0.0-...-4fd71c7 Latest Latest
Warning

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

Go to latest
Published: May 24, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package adapters implements adapters for JWK data.

Index

Constants

This section is empty.

Variables

View Source
var ErrKeyNotFound = errors.New("Key not found")

ErrKeyNotFound defines an error when requested key was not found.

Functions

This section is empty.

Types

type Set

type Set interface {
	// Add a new key.
	Add(jwk.Key) error

	// All returns all keys.
	All() (*jwk.Set, error)

	// ByID returns a key by its identifier.
	ByID(string) (*jwk.Key, error)
}

A Set represents a data adapter for JWK key set.

type SetMemory

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

A SetMemory represents an in-memory data adapter for JWK key set.

func NewSetMemory

func NewSetMemory() *SetMemory

NewSetMemory creates a new instance of SetMemory.

func (*SetMemory) Add

func (s *SetMemory) Add(key jwk.Key) error

Add a new key to current data adapter.

func (*SetMemory) All

func (s *SetMemory) All() (*jwk.Set, error)

All returns all keys.

func (*SetMemory) ByID

func (s *SetMemory) ByID(id string) (*jwk.Key, error)

ByID returns a key by its identifier.

type SetMongo

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

A SetMongo represents a MongoDB data adapter for JWK key set.

func NewSetMongo

func NewSetMongo(col *mgo.Collection) *SetMongo

NewSetMongo creates a new instance of SetMongo.

func (*SetMongo) Add

func (s *SetMongo) Add(key jwk.Key) error

Add a new key to database.

func (*SetMongo) All

func (s *SetMongo) All() (*jwk.Set, error)

All returns all keys.

func (*SetMongo) ByID

func (s *SetMongo) ByID(id string) (*jwk.Key, error)

ByID returns a key by its identifier.

Jump to

Keyboard shortcuts

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