cluster

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID           string    `json:"id"`
	Kind         string    `json:"kind"`
	HRef         string    `json:"href"`
	FirstName    string    `json:"first_name"`
	LastName     string    `json:"last_name"`
	Username     string    `json:"username"`
	Email        string    `json:"email"`
	Banned       bool      `json:"banned"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
	Organization Org       `json:"organization"`
}

func GetCurrentAccount

func GetCurrentAccount(wrapper client.Wrapper, reg Registration) (*Account, error)

GetCurrentAccount uses a new flow with direct cluster tokenauth

type AccountError

type AccountError struct {
	Href        string `json:"href"`
	ID          string `json:"id"`
	Kind        string `json:"kind"`
	Code        string `json:"code"`
	OperationId string `json:"operation_id"`
	Reason      string `json:"reason"`
	Inner       error  `json:"-"`
}

AccountError - holds error information returned from accounts endpoint if error occurred

func (*AccountError) Error

func (a *AccountError) Error() string

func (*AccountError) MarshalLogObject

func (a *AccountError) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*AccountError) Unwrap

func (a *AccountError) Unwrap() error

func (*AccountError) Verbose

func (a *AccountError) Verbose() []byte

type ErrorWithBodyWrapper

type ErrorWithBodyWrapper struct {
	AccountError *AccountError
	StatusCode   int
}

func (*ErrorWithBodyWrapper) Do

func (e *ErrorWithBodyWrapper) Do(req *http.Request, label string, cluster_id string, authorization_token string) ([]byte, error)

type ErrorWrapper

type ErrorWrapper struct{}

func (*ErrorWrapper) Do

func (e *ErrorWrapper) Do(req *http.Request, label string, cluster_id string, authorization_token string) ([]byte, error)

type FakeWrapper

type FakeWrapper struct {
	GetAccountResponse *Account
}

func (*FakeWrapper) Do

func (f *FakeWrapper) Do(req *http.Request, label string, cluster_id string, authorization_token string) ([]byte, error)

type Identity

type Identity struct {
	AccountNumber string            `json:"account_number"`
	OrgID         string            `json:"org_id"`
	Type          string            `json:"type"`
	Internal      Internal          `json:"internal"`
	System        map[string]string `json:"system,omitempty"`
}

func GetIdentity

func GetIdentity(wrapper client.Wrapper, reg Registration) (*Identity, error)

GetIdentity is a facade over all the steps required to get an Identity

type Internal

type Internal struct {
	OrgID string `json:"org_id"`
}

type Org

type Org struct {
	ID           string    `json:"id"`
	Kind         string    `json:"kind"`
	HRef         string    `json:"href"`
	Name         string    `json:"name"`
	ExternalID   string    `json:"external_id"`
	EbsAccountID string    `json:"ebs_account_id"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
}

type Registration

type Registration struct {
	ClusterID          string `json:"cluster_id"`
	AuthorizationToken string `json:"authorization_token"`
}

Registration is the document posted to cluster registration service

Jump to

Keyboard shortcuts

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