state

package
v0.0.0-...-8d6e374 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePEM

func CreatePEM(pemFile string, writer security.PEMWriter) error

CreatePEM takes a file name and a pem writer, creates a file and writes the pem bytes out

func LoadIdentityFromFiles

func LoadIdentityFromFiles(id string, keyFile string, crtFile string, csrFile string) (*security.Identity, error)

LoadIdentityFiles takes the id of an identity and the full path names of the key, certificate & request files and will create a new identity and try to load the specified files.

func StoreIdentityInFiles

func StoreIdentityInFiles(i *security.Identity, keyFile string, crtFile string, csrFile string) error

StoreIdentityInFiles takes an identity, along with a key, certificate and request file name and will write any of the Key, Certificate or Request on the identity if set.

Types

type DirectorEvent

type DirectorEvent struct {
	Action string
	Node   string
}

type State

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

func NewState

func NewState(etcHosts []string) *State

NewState creates a new state object and connects to the specified etc hosts

func (*State) AddIdentityToPending

func (s *State) AddIdentityToPending(identity *security.Identity) error

AddIdentityToPending adds the provided identity to the pending list

func (*State) DirectorHeartbeat

func (s *State) DirectorHeartbeat(id string, interval uint64)

DirectorHeartbeat is a simple function that sets a key with our ID every heartbeatInterval

func (*State) DiscoverDirectors

func (s *State) DiscoverDirectors(localId string, events chan *DirectorEvent)

DiscoverDirectors

func (*State) GetPendingIdentities

func (s *State) GetPendingIdentities() ([]string, error)

GetPendingIdentities returns a string slice with all of the pending ids

func (*State) LoadAuthority

func (s *State) LoadAuthority() (*security.Authority, error)

LoadAuthority fetches the authority information

func (*State) LoadIdentity

func (s *State) LoadIdentity(id string) (*security.Identity, error)

LoadIdentity loads the identity with the id specified

func (*State) RemoveIdentity

func (s *State) RemoveIdentity(identity *security.Identity) error

Remove an identity from the state

func (*State) RemoveIdentityFromPending

func (s *State) RemoveIdentityFromPending(identity *security.Identity) error

RemoveIdentityFromPending removes the provided identity from the pending list

func (*State) StoreAuthority

func (s *State) StoreAuthority(authority *security.Authority) error

func (*State) StoreAuthoritySerial

func (s *State) StoreAuthoritySerial(authority *security.Authority) error

func (*State) StoreIdentity

func (s *State) StoreIdentity(identity *security.Identity) error

StoreIdentity stores the specified identity in etcd

Jump to

Keyboard shortcuts

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