secrets

package
v1.1.14 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetService

func SetService(svc Service)

Types

type DefaultService

type DefaultService struct{}

func (*DefaultService) Delete

func (*DefaultService) Delete(ctx context.ServiceContext, client *clients.GQLClient, options *DeleteOptions) (*dto.Secret, error)

--- Flow ---

If the secret has a remote environment ID saved, then delete the values from the remote environment. Else, delete the values from the local environment.

func (*DefaultService) Get

func (*DefaultService) Get(ctx context.ServiceContext, client *clients.GQLClient, options *GetOptions) (*dto.Secret, error)

--- Flow ---

If the secret has a remote environment ID saved, then get the values from the remote environment. Else, get the values from the local environment.

func (*DefaultService) Init

func (d *DefaultService) Init(ctx context.ServiceContext, client *clients.GQLClient, options *RemoteConfig) (*dto.Secret, error)

func (*DefaultService) List

func (*DefaultService) List(ctx context.ServiceContext, client *clients.GQLClient, options *ListOptions) (*dto.KPMap, error)

--- Flow ---

If the secret has a remote environment ID saved, then get the array of keys from the remote environment. Else, get the array of keys from the local environment.

func (*DefaultService) Set

func (*DefaultService) Set(ctx context.ServiceContext, client *clients.GQLClient, secret *dto.Secret) error

--- Flow ---

If the secret has a remote environment ID saved, then set the values in the remote environment. Else, update the values in the local environment.

type DeleteOptions

type DeleteOptions struct {
	Key     string `json:"key"`
	EnvID   string `json:"env_id"`
	Version *int   `json:"version,omitempty"`
}

type GetOptions

type GetOptions struct {
	Key     string `json:"key"`
	EnvID   string `json:"env_id"`
	Version *int   `json:"version,omitempty"`
}

type ListOptions

type ListOptions struct {
	EnvID   string `json:"env_id"`
	Version *int   `json:"version,omitempty"`
}

type RemoteConfig

type RemoteConfig struct {
	EnvironmentName string `json:"env_name"`
	ProjectID       string `json:"project_id"`
}

type Secret

type Secret struct {
	dto.Secret
}

func (*Secret) IsRemote

func (s *Secret) IsRemote() bool

Returns a boolean response subject to whether or not the secret has a non-empty environment ID.

func (*Secret) UnmarshalJSON

func (s *Secret) UnmarshalJSON(data []byte) error

Custom unmarsaller for the Secret struct.

Jump to

Keyboard shortcuts

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