store

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultOrNilOrg

func GetDefaultOrNilOrg(orgs []brevapi.Organization) *brevapi.Organization

func NewRestyClient

func NewRestyClient(brevAPIURL string) *resty.Client

Types

type Auth

type Auth interface {
	GetAccessToken() (string, error)
}

type AuthHTTPClient

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

func NewAuthHTTPClient

func NewAuthHTTPClient(auth Auth, brevAPIURL string) *AuthHTTPClient

type AuthHTTPStore

type AuthHTTPStore struct {
	NoAuthHTTPStore
	// contains filtered or unexported fields
}

func (AuthHTTPStore) CreateOrganization

func (s AuthHTTPStore) CreateOrganization(req CreateOrganizationRequest) (*brevapi.Organization, error)

func (AuthHTTPStore) CreateSecret

func (AuthHTTPStore) GetActiveOrganizationOrDefault

func (s AuthHTTPStore) GetActiveOrganizationOrDefault() (*brevapi.Organization, error)

returns the 'set'/active organization or the default one or nil if no orgs exist

func (AuthHTTPStore) GetActiveOrganizationOrNil

func (s AuthHTTPStore) GetActiveOrganizationOrNil() (*brevapi.Organization, error)

returns the 'set'/active organization or nil if not set

func (AuthHTTPStore) GetAllWorkspaces

func (s AuthHTTPStore) GetAllWorkspaces(options *GetWorkspacesOptions) ([]brevapi.Workspace, error)

func (AuthHTTPStore) GetCurrentUser

func (s AuthHTTPStore) GetCurrentUser() (*brevapi.User, error)

func (AuthHTTPStore) GetCurrentUserKeys

func (s AuthHTTPStore) GetCurrentUserKeys() (*brevapi.UserKeys, error)

func (AuthHTTPStore) GetOrganizations

func (s AuthHTTPStore) GetOrganizations() ([]brevapi.Organization, error)

func (AuthHTTPStore) GetWorkspace

func (s AuthHTTPStore) GetWorkspace(workspaceID string) (*brevapi.Workspace, error)

func (AuthHTTPStore) GetWorkspaceMetaData

func (s AuthHTTPStore) GetWorkspaceMetaData(workspaceID string) (*brevapi.WorkspaceMetaData, error)

func (AuthHTTPStore) GetWorkspaces

func (s AuthHTTPStore) GetWorkspaces(organizationID string, options *GetWorkspacesOptions) ([]brevapi.Workspace, error)

func (AuthHTTPStore) NewAuthHTTPStore

func (s AuthHTTPStore) NewAuthHTTPStore() *AuthHTTPStore

Used if need new instance to customize settings

func (*AuthHTTPStore) SetOnAuthFailureHandler

func (s *AuthHTTPStore) SetOnAuthFailureHandler(handler func() error)

func (AuthHTTPStore) StopWorkspace

func (s AuthHTTPStore) StopWorkspace(workspaceID string) (*brevapi.Workspace, error)

type BasicStore

type BasicStore struct{}

func NewBasicStore

func NewBasicStore() *BasicStore

func (*BasicStore) WithFileSystem

func (b *BasicStore) WithFileSystem(fs afero.Fs) *FileStore

type CreateOrganizationRequest

type CreateOrganizationRequest struct {
	Name string `json:"name"`
}

type CreateSecretRequest

type CreateSecretRequest struct {
	Name          string        `json:"name"`
	HierarchyType HierarchyType `json:"hierarchyType"`
	HierarchyID   string        `json:"hierarchyID"`
	Src           SecretReqSrc  `json:"src"`
	Dest          SecretReqDest `json:"dest"`
}

type DestConfig

type DestConfig struct {
	Name string `json:"name,omitempty"`
	Path string `json:"path,omitempty"`
}

type DestType

type DestType string
const (
	File        DestType = "file"
	EnvVariable DestType = "env"
)

type FileStore

type FileStore struct {
	BasicStore
	// contains filtered or unexported fields
}

func (FileStore) CreateNewSSHConfigBackup

func (f FileStore) CreateNewSSHConfigBackup() error

func (FileStore) GetPrivateKeyFilePath

func (f FileStore) GetPrivateKeyFilePath() string

func (FileStore) GetSSHConfig

func (f FileStore) GetSSHConfig() (string, error)

!! need something to resolve file path of user ssh

func (*FileStore) WithAuthHTTPClient

func (f *FileStore) WithAuthHTTPClient(c *AuthHTTPClient) *AuthHTTPStore

func (*FileStore) WithNoAuthHTTPClient

func (f *FileStore) WithNoAuthHTTPClient(c *NoAuthHTTPClient) *NoAuthHTTPStore

func (FileStore) WritePrivateKey

func (f FileStore) WritePrivateKey(pem string) error

func (FileStore) WriteSSHConfig

func (f FileStore) WriteSSHConfig(config string) error

type GetWorkspacesOptions

type GetWorkspacesOptions struct {
	UserID string
	Name   string
}

type HTTPResponseError

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

func NewHTTPResponseError

func NewHTTPResponseError(response *resty.Response) *HTTPResponseError

func (HTTPResponseError) Error

func (e HTTPResponseError) Error() string

type HierarchyType

type HierarchyType string
const (
	Org  HierarchyType = "org"
	User HierarchyType = "user"
)

type NoAuthHTTPClient

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

func NewNoAuthHTTPClient

func NewNoAuthHTTPClient(brevAPIURL string) *NoAuthHTTPClient

type NoAuthHTTPStore

type NoAuthHTTPStore struct {
	FileStore
	// contains filtered or unexported fields
}

func (NoAuthHTTPStore) CreateUser

func (n NoAuthHTTPStore) CreateUser(identityToken string) (*brevapi.User, error)

func (NoAuthHTTPStore) NewNoAuthHTTPStore

func (n NoAuthHTTPStore) NewNoAuthHTTPStore() *NoAuthHTTPStore

Used if need new instance to customize settings

func (*NoAuthHTTPStore) WithAuth

func (n *NoAuthHTTPStore) WithAuth(auth Auth) *AuthHTTPStore

func (*NoAuthHTTPStore) WithAuthHTTPClient

func (n *NoAuthHTTPStore) WithAuthHTTPClient(c *AuthHTTPClient) *AuthHTTPStore

type SecretReqDest

type SecretReqDest struct {
	Type   DestType   `json:"type"`
	Config DestConfig `json:"config"`
}

type SecretReqSrc

type SecretReqSrc struct {
	Type   SrcType   `json:"type"`
	Config SrcConfig `json:"config"`
}

type SrcConfig

type SrcConfig struct {
	Value string `json:"value"`
}

type SrcType

type SrcType string
const (
	KeyValue SrcType = "kv2"
)

Jump to

Keyboard shortcuts

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