mailproxy: github.com/katzenpost/mailproxy/internal/authority Index | Files

package authority

import "github.com/katzenpost/mailproxy/internal/authority"

Package authority implements the generic PKI backend.

Index

Package Files

authority.go

type Authority Uses

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

Authority is a directory authority instance.

func (*Authority) Client Uses

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

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

func (*Authority) Deref Uses

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 Uses

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 Uses

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

Store is a group of Authority instances.

func NewStore Uses

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

NewStore constructs a new Store instance.

func (*Store) Get Uses

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

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

func (*Store) Reset Uses

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 Uses

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.

Package authority imports 6 packages (graph) and is imported by 4 packages. Updated 2018-06-09. Refresh now. Tools for package owners.