tweed

package module
v0.0.0-...-be8df21 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// don't forget to update the api/responses.go copies as well!
	QuietState          = "quiet"
	ProvisioningState   = "provisioning"
	DeprovisioningState = "deprovisioning"
	GoneState           = "gone"
	BindingState        = "binding"
	UnbindingState      = "unbinding"
)
View Source
const (
	TextParameter     = "text"
	BytesParameter    = "bytes"
	NumericParameter  = "number"
	DurationParameter = "duration"
)

Variables

This section is empty.

Functions

func DirExists

func DirExists(path string) bool

func FileExists

func FileExists(path string) bool

func ValidInstanceID

func ValidInstanceID(id string) error

func ValidInstancePrefix

func ValidInstancePrefix(s string) error

Types

type Catalog

type Catalog struct {
	Services []Service `json:"services"`
}

func (Catalog) FindPlan

func (c Catalog) FindPlan(service, plan string) (*Plan, error)

type Config

type Config struct {
	Vault struct {
		Prefix string `json:"prefix"`
		URL    string `json:"url"`
		Token  string `json:"token"`
	} `json:"vault"`

	Prefix          string                    `json:"prefix"`
	Infrastructures map[string]Infrastructure `json:"infrastructures"`
	Catalog         Catalog                   `json:"catalog"`
}

func ParseConfig

func ParseConfig(b []byte) (Config, error)

func ReadConfig

func ReadConfig(path string) (Config, error)

type Core

type Core struct {
	Root             string
	HTTPAuthUsername string
	HTTPAuthPassword string
	HTTPAuthRealm    string

	Config Config
	// contains filtered or unexported fields
}

func (*Core) API

func (c *Core) API() *route.Router

func (*Core) Bind

func (c *Core) Bind(id, bid string) (string, error)

func (*Core) Count

func (c *Core) Count(plan *Plan) int

func (*Core) Deprovision

func (c *Core) Deprovision(id string) (string, bool, error)

func (*Core) KeepErrors

func (c *Core) KeepErrors(n int)

func (*Core) OSB

func (c *Core) OSB() http.Handler

func (*Core) OSBBroker

func (c *Core) OSBBroker() brokerapi.ServiceBroker

func (*Core) Provision

func (c *Core) Provision(inst *Instance) (string, error)

func (*Core) Scan

func (c *Core) Scan() error

func (*Core) SetupInfrastructures

func (c *Core) SetupInfrastructures() error

func (*Core) SetupVault

func (c *Core) SetupVault() error

func (*Core) Unbind

func (c *Core) Unbind(id, bid string) (string, error)

func (*Core) UpdateCatalogNumbers

func (c *Core) UpdateCatalogNumbers()

func (*Core) ValidateCatalog

func (c *Core) ValidateCatalog() error

func (*Core) WaitForVault

func (c *Core) WaitForVault()

type Errors

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

func (Errors) Error

func (e Errors) Error() string

type Exec

type Exec struct {
	Run    string
	Env    []string
	Stdout chan string
	Stderr chan string
	Done   chan int
}

type File

type File struct {
	Filename    string `json:"filename"`
	Summary     string `json:"summary"`
	Description string `json:"description"`
	Contents    string `json:"contents"`
}

type Infrastructure

type Infrastructure struct {
	Type string `json:"type"`

	URL           string `json:"url"`
	ClientID      string `json:"client_id"`
	ClientSecret  string `json:"client_secret"`
	CACertificate string `json:"ca_certificate"`

	KubeConfig string `json:"kubeconfig"`
}

func (Infrastructure) Render

func (infra Infrastructure) Render() (string, error)

func (Infrastructure) Valid

func (infra Infrastructure) Valid() error

type Instance

type Instance struct {
	ID    string
	Plan  *Plan
	State string

	Root        string
	Prefix      string
	VaultPrefix string

	UserParameters map[string]interface{}
	Bindings       map[string]map[string]interface{}

	Tasks []*task
}

func ParseInstance

func ParseInstance(cat Catalog, root string, b []byte) (Instance, error)

func (*Instance) Bind

func (i *Instance) Bind(id string) (*task, error)

func (*Instance) CredentialOverrides

func (i *Instance) CredentialOverrides() string

func (*Instance) Deprovision

func (i *Instance) Deprovision() (*task, error)

func (*Instance) Files

func (i *Instance) Files() ([]File, error)

func (Instance) IsBusy

func (i Instance) IsBusy() bool

func (Instance) IsGone

func (i Instance) IsGone() bool

func (Instance) IsQuiet

func (i Instance) IsQuiet() bool

func (*Instance) Log

func (i *Instance) Log() string

func (*Instance) LookupBinding

func (i *Instance) LookupBinding(id string) error

func (*Instance) LookupBindings

func (i *Instance) LookupBindings() error

func (*Instance) Provision

func (i *Instance) Provision() (*task, error)

func (*Instance) Purge

func (i *Instance) Purge() error

func (*Instance) Unbind

func (i *Instance) Unbind(id string) (*task, error)

func (*Instance) Viable

func (i *Instance) Viable() error

type MalformedParameterSpec

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

func (MalformedParameterSpec) Error

func (e MalformedParameterSpec) Error() string

type Parameter

type Parameter struct {
	Type    string `json:"type"`
	Minimum string `json:"minimum"`
	Maximum string `json:"maximum"`
}

func (Parameter) Validate

func (p Parameter) Validate(value string) error

func (Parameter) Wellformed

func (p Parameter) Wellformed() error

type ParameterValueOutOfRange

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

func (ParameterValueOutOfRange) Error

func (e ParameterValueOutOfRange) Error() string

type Plan

type Plan struct {
	Name        string `json:"name"`
	ID          string `json:"id"`
	Description string `json:"description"`

	Metadata       map[string]interface{} `json:"metadata"`
	Free           bool                   `json:"free"`
	Bindable       bool                   `json:"bindable"`
	PlanUpdateable bool                   `json:"plan_updateable"`

	MaintenanceInfo struct {
		Version     string `json:"version"`
		Description string `json:"description"`
	} `json:"maintenance_info"`

	Service *Service `json:"-"`

	Tweed struct {
		Infrastructure string `json:"infrastructure"`
		Stencil        string `json:"stencil"`

		Credentials map[string]interface{} `json:"credentials"`

		// populated by Tweed, to convey actual instance
		// count information to catalog consumers.
		Provisioned int `json:"provisioned"`
		Limit       int `json:"limit"`

		Config map[string]interface{} `json:"config"`
		Params map[string]Parameter   `json:"params"`

		// populated by Tweed, to make scripting
		// with the API / CLI --json mode easier.
		Reference string `json:"reference"`
	} `json:"tweed"`
}

func (*Plan) Same

func (p *Plan) Same(other *Plan) bool

func (Plan) ValidateInputs

func (p Plan) ValidateInputs(inputs map[string]string) error

type Service

type Service struct {
	Name        string   `json:"name"`
	ID          string   `json:"id"`
	Description string   `json:"description"`
	Tags        []string `json:"tags"`

	Bindable             bool `json:"bindable"`
	InstancesRetrievable bool `json:"instances_retrievable"`
	BindingsRetrievable  bool `json:"bindings_retrievable"`
	AllowContextUpdates  bool `json:"allow_context_updates"`
	PlanUpdateable       bool `json:"plan_updateable"`

	Metadata map[string]interface{} `json:"metadata"`

	Plans []*Plan `json:"plans"`
}

type WrongParameterValueType

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

func (WrongParameterValueType) Error

func (e WrongParameterValueType) Error() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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