persistence

package
v2.9.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const GroupProjectType = "grouping"
View Source
const SimpleProjectType = "simple"

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Name        string      `yaml:"name"`
	AccountUUID TypedValue  `yaml:"accountUUID"`
	ApiUrl      *TypedValue `yaml:"apiUrl,omitempty"`
	OAuth       OAuth       `yaml:"oAuth"`
}

type Auth

type Auth struct {
	Token AuthSecret `yaml:"token"`
	OAuth *OAuth     `yaml:"oAuth,omitempty"`
}

type AuthSecret

type AuthSecret struct {
	Type Type   `yaml:"type"`
	Name string `yaml:"name"`
}

AuthSecret represents a user-defined client id or client secret. It has a Type which is TypeEnvironment (default). Secrets must never be provided as plain text, but always loaded from somewhere else. Currently, loading is only allowed from environment variables.

[Name] contains the environment-variable to resolve the authSecret.

This struct is meant to be reused for fields that require the same behavior.

type Environment

type Environment struct {
	Name string     `yaml:"name"`
	URL  TypedValue `yaml:"url"`

	// Auth contains all authentication related information
	Auth Auth `yaml:"auth,omitempty"`
}

type Group

type Group struct {
	Name         string        `yaml:"name"`
	Environments []Environment `yaml:"environments"`
}

type Manifest

type Manifest struct {
	ManifestVersion   string    `yaml:"manifestVersion"`
	Projects          []Project `yaml:"projects"`
	EnvironmentGroups []Group   `yaml:"environmentGroups"`
	Accounts          []Account `yaml:"accounts,omitempty"`
}

type OAuth

type OAuth struct {
	ClientID      AuthSecret  `yaml:"clientId"`
	ClientSecret  AuthSecret  `yaml:"clientSecret"`
	TokenEndpoint *TypedValue `yaml:"tokenEndpoint,omitempty"`
}

type Project

type Project struct {
	Name string `yaml:"name"`
	Type string `yaml:"type,omitempty"`
	Path string `yaml:"path,omitempty"`
}

type Type added in v2.9.3

type Type string
const (
	TypeEnvironment Type = "environment"
	TypeValue       Type = "value"
)

type TypedValue added in v2.9.3

type TypedValue struct {
	Type  Type   `yaml:"type,omitempty" mapstructure:"type"`
	Value string `yaml:"value" mapstructure:"value"`
}

TypedValue represents a value with a Type - currently these are variables that can be either: - TypeEnvironment...loaded from an environment variable - TypeValue...read directly Additionally TypedValues can be defined directly as a string, as a shorthand for type: TypeValue

func (*TypedValue) UnmarshalYAML added in v2.9.3

func (c *TypedValue) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML Custom unmarshaler for TypedValue able to parse simple shorthands (accountUUID: 1234) and full values.

Jump to

Keyboard shortcuts

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