authority

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package authority implements the generic PKI backend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authority

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

Authority is a directory authority instance.

func (*Authority) Client

func (a *Authority) Client() pki.Client

Client returns the pki.Client instance associated with the Authority.

func (*Authority) Deref

func (a *Authority) Deref()

Deref decrements the reference count of the Authority. If the reference count reaches 0, the Authority will be torn down and removed from it's associated Store.

type Factory

type Factory interface {
	New(*log.Backend, *proxy.Config) (pki.Client, error)
}

Factory constructs a new pki.Client instance with a pre-set configuration.

type Store

type Store struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Store is a group of Authority instances.

func NewStore

func NewStore(l *log.Backend, pCfg *proxy.Config) *Store

NewStore constructs a new Store instance.

func (*Store) Get

func (s *Store) Get(id string) (*Authority, error)

Get returns the Authority identified by id, after incrementing the reference count.

func (*Store) Reset

func (s *Store) Reset()

Reset clears the Store after Deref()ing each Authority. If any Authority has any other existing references, this call will panic.

func (*Store) Set

func (s *Store) Set(id string, f Factory) error

Set sets the Authority identified by id, to a new pki.Client constructed by the provided factory f, wrapped in a caching wrapper.

Jump to

Keyboard shortcuts

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