secrets

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateState

func CreateState(client *kubernetes.Clientset) error

CreateState creates an empty state of the credentials

func UpdateState

func UpdateState(client *kubernetes.Clientset, state *State) error

UpdateState updates the state of the credentials

Types

type CredsSecrets

type CredsSecrets struct {
	creds.Creds

	State *State
	// contains filtered or unexported fields
}

CredsSecrets implements CredsIf using Kubernetes secrets

func NewCredsSecrets

func NewCredsSecrets() *CredsSecrets

NewCredsSecrets creates a new CredsSecrets

func (*CredsSecrets) AllocateNatsAccount

func (c *CredsSecrets) AllocateNatsAccount(network string) (string, error)

AllocateNatsAccount allocates a new nats account if possible

func (*CredsSecrets) DeleteNetwork added in v0.4.0

func (c *CredsSecrets) DeleteNetwork(network string) error

DeleteNetwork deletes the network from the credentials.

func (*CredsSecrets) DesiredState

func (c *CredsSecrets) DesiredState(network string, participants []string) (*api.DesiredStateResponse, error)

DesiredState constructs the desired state of credentials for a given application name

func (*CredsSecrets) GetNatsServerInfos added in v0.7.0

func (c *CredsSecrets) GetNatsServerInfos() (*api.ServerInformationResponse, error)

GetNatsServerInfos returns the nats server information

func (*CredsSecrets) GetSysAccount added in v0.7.0

func (c *CredsSecrets) GetSysAccount() (*api.SysAccount, error)

type NatsAccountMapping

type NatsAccountMapping struct {
	NatsAccount string `json:"natsaccount"`
	Network     string `json:"network"`
}

State stores the current state of the credentials (all used accounts)

type ParticipantMapping added in v0.4.0

type ParticipantMapping struct {
	Network     string             `json:"network"`
	Credentials []*api.Credentials `json:"credentials"`
}

State stores information about the current state of the credentials

type State

type State struct {
	// UsedAccounts map the used ngs nats account to the account name specified by the user
	UsedAccounts []NatsAccountMapping `json:"usedaccounts"`
	// ParticipantMappings map the participant specified network name to the credentials
	ParticipantMappings []ParticipantMapping `json:"participantmappings"`
}

State stores the current state of the anck-credentials

func ReadState

func ReadState(client *kubernetes.Clientset) (*State, error)

ReadState reads the state of the credentials and returns struct State

Jump to

Keyboard shortcuts

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