key

package
Version: v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2017 License: BSD-3-Clause Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyNotFound         = errors.New("key not found")
	ErrKeyRefAlreadyExists = errors.New("key reference already exists")
	ErrKeyRefRequired      = errors.New("key reference required")
)

Errors that are related to the Key Service.

Functions

This section is empty.

Types

type Key

type Key struct {
	Secret             string      `json:"secret"`
	Ref                string      `json:"ref"`
	AuthorizedNetworks []net.IPNet `json:"authorized-networks,omitempty"`
}

type Keys

type Keys []Key

type KeysPage

type KeysPage struct {
	Keys     Keys   `json:"keys"`
	Previous string `json:"previous,omitempty"`
	Next     string `json:"next,omitempty"`
	Count    int    `json:"count,omitempty"`
}

type Options

type Options struct {
	AuthorizedNetworks *[]net.IPNet `json:"authorized-networks,omitempty"`
}

type Service

type Service interface {
	KeyByRef(ref string) (*Key, error)
	KeyBySecret(secret string) (*Key, error)
	CreateKey(ref string, o *Options) (*Key, error)
	UpdateKey(ref string, o *Options) (*Key, error)
	DeleteKey(ref string) error
	RegenerateSecret(ref string) (string, error)
	Keys(startID string, limit int) (KeysPage, error)
}

Source Files

Directories

Path Synopsis
Package boltKey provides a Service that is using local BoltDB database to store Key data.
Package boltKey provides a Service that is using local BoltDB database to store Key data.
Package httpKey provides a HTTP client to an external key service that can respond to HTTP requests defined here.
Package httpKey provides a HTTP client to an external key service that can respond to HTTP requests defined here.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL