state

package
v0.0.0-...-a6f3347 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int
const (
	None Action = iota
	NoOverwrite
	BoshDeploy
	Regenerate
	CleanUp
	MarkTransitional
	UnMarkTransitional
)

func ActionString

func ActionString(s string) (Action, error)

ActionString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ActionValues

func ActionValues() []Action

ActionValues returns all values of the enum

func (Action) IsAAction

func (i Action) IsAAction() bool

IsAAction returns "true" if the value is listed in the enum definition. "false" otherwise

func (Action) MarshalJSON

func (i Action) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for Action

func (Action) String

func (i Action) String() string

func (*Action) UnmarshalJSON

func (i *Action) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for Action

type Collector

type Collector func(c *Credential) Credentials

func SibilingsCollector

func SibilingsCollector() Collector

func SignedByCollector

func SignedByCollector() Collector

func SignsCollector

func SignsCollector() Collector

type Credential

type Credential struct {
	*credhub.Credential
	Deployments  Deployments `json:"-"`
	SignedBy     *Credential `json:"-"`
	ReferencedBy Credentials `json:"-"`
	References   Credentials `json:"-"`
	Signs        Credentials `json:"-"`
	Latest       bool        `json:"latest"`
	Signing      *bool       `json:"signing,omitempty"`
	Path         *Path       `json:"-"`
}

func (*Credential) Active

func (c *Credential) Active() bool

func (*Credential) ActiveAndNotSeenBefore

func (c *Credential) ActiveAndNotSeenBefore(credsSeen Credentials) bool

func (*Credential) LatestDeployedTo

func (c *Credential) LatestDeployedTo(deployment string) *Credential

func (*Credential) MarshalJSON

func (c *Credential) MarshalJSON() ([]byte, error)

func (*Credential) NextAction

func (cred *Credential) NextAction(r RegenerationCriteria) Action

func (*Credential) PathVersion

func (c *Credential) PathVersion() string

func (*Credential) PendingDeploys

func (c *Credential) PendingDeploys() Deployments

func (*Credential) PrintCreatedAt

func (c *Credential) PrintCreatedAt() string

func (*Credential) PrintExpiry

func (c *Credential) PrintExpiry() string

func (*Credential) Summary

func (c *Credential) Summary() string

type Credentials

type Credentials []*Credential

func (Credentials) Any

func (creds Credentials) Any() bool

func (Credentials) Collect

func (creds Credentials) Collect(fn Collector) Credentials

func (Credentials) Find

func (creds Credentials) Find(filters ...Filter) (cred *Credential, found bool)

func (Credentials) Includes

func (ceds Credentials) Includes(this *Credential) bool

func (Credentials) Select

func (creds Credentials) Select(filters ...Filter) Credentials

func (Credentials) SortByCreatedAt

func (creds Credentials) SortByCreatedAt()

func (Credentials) SortByNameAndCreatedAt

func (creds Credentials) SortByNameAndCreatedAt()

func (Credentials) Unique

func (creds Credentials) Unique() Credentials

type Deployment

type Deployment struct {
	Versions Credentials `json:"-"`
	Name     string      `json:"name"`
}

type Deployments

type Deployments []*Deployment

func (Deployments) Includes

func (d Deployments) Includes(this *Deployment) bool

func (Deployments) IncludesName

func (d Deployments) IncludesName(name string) bool

func (Deployments) String

func (d Deployments) String() string

type Filter

type Filter func(*Credential) bool

func ActiveFilter

func ActiveFilter() Filter

func AndFilter

func AndFilter(fns ...Filter) Filter

func AnyFilter

func AnyFilter(fn Collector) Filter

func CertificateAuthorityFilter

func CertificateAuthorityFilter(expected bool) Filter

func DeploymentFilter

func DeploymentFilter(deployment string) Filter

func ExpiresBeforeFilter

func ExpiresBeforeFilter(t time.Time) Filter

func LatestFilter

func LatestFilter() Filter

func NameFilter

func NameFilter(name string) Filter

func NotFilter

func NotFilter(fn Filter) Filter

func OlderThanFilter

func OlderThanFilter(t time.Time) Filter

func OrFilter

func OrFilter(fns ...Filter) Filter

func References

func References(c *Credential) Filter

func SelfSignedFilter

func SelfSignedFilter() Filter

func SignedByFilter

func SignedByFilter(name string) Filter

func SigningFilter

func SigningFilter() Filter

func TransitionalFilter

func TransitionalFilter() Filter

func TypeFilter

func TypeFilter(types ...credhub.CredentialType) Filter

type Path

type Path struct {
	Name               string                   `json:"name"`
	Versions           Credentials              `json:"-"`
	VariableDefinition *bosh.VariableDefinition `json:"variable_definition"`
	Deployments        Deployments
}

type RegenerationCriteria

type RegenerationCriteria struct {
	OlderThan        time.Time
	ExpiresBefore    time.Time
	IgnoreUpdateMode bool
}

type State

type State interface {
	Update([]*credhub.Credential, []*bosh.Variable) error
	Credentials(...Filter) Credentials
}

func NewState

func NewState() State

Jump to

Keyboard shortcuts

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