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 GenerateRandomString ¶
func UpdateState ¶
func UpdateState(client *kubernetes.Clientset, state *State) error
UpdateState updates the state of the credentials
Types ¶
type CredsSecrets ¶
CredsSecrets implements CredsIf using Kubernetes secrets
func NewCredsSecrets ¶
func NewCredsSecrets() *CredsSecrets
NewCredsSecrets creates a new CredsSecrets
func (*CredsSecrets) AllocateNatsAccount ¶
func (c *CredsSecrets) AllocateNatsAccount(applicationName string) (string, error)
AllocateNatsAccount allocates a new nats account if possible
func (*CredsSecrets) DeleteAccount ¶
func (c *CredsSecrets) DeleteAccount(accountName string) error
DeleteAccount deletes the account from the credentials.
func (*CredsSecrets) DesiredState ¶
func (c *CredsSecrets) DesiredState(accountName string, usernames []string) (*api.DesiredStateResponse, error)
DesiredState constructs the desired state of credentials for a given application name
type NatsAccountMapping ¶
type NatsAccountMapping struct { Account string `json:"account"` ApplicationName string `json:"application"` }
State stores the current state of the credentials (all used accounts)
type State ¶
type State struct { // UsedAccounts map the used ngs nats account to the account name specified by the user UsedAccounts []NatsAccountMapping `json:"usedaccounts"` // UserMappings map the user specified account name to the credentials UserMappings []UserMapping `json:"usermapping"` }
State stores the current state of the anck-credentials
type UserMapping ¶
type UserMapping struct { ApplicationName string `json:"application"` Credentials []*api.Credentials `json:"credentials"` }
State stores information about the current state of the credentials
Click to show internal directories.
Click to hide internal directories.