cloudru

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const EndpointsURI = "https://api.cloud.ru/endpoints"

EndpointsURI is the URI for getting the actual Cloud.ru API endpoints.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	IAM struct {
		Address string `env:"ADDRESS"`

		ClientID     string `env:"CLIENT_ID,file,required,notEmpty"`
		ClientSecret string `env:"CLIENT_SECRET,file,required,notEmpty" json:"-"`
	} `envPrefix:"IAM_"`
	CSM struct {
		Address string `env:"ADDRESS"`
	} `envPrefix:"CSM_"`

	DiscoveryURL string `env:"DISCOVERY_URL"`

	ProjectID string `env:"PROJECT_ID,required"`

	RootFolder           RootFolder `env:"ROOT_FOLDER"`
	RootFolderOmitPrefix bool       `env:"ROOT_FOLDER_OMIT_PREFIX"`
}

func (Config) Validate added in v0.2.0

func (c Config) Validate() error

type Endpoint

type Endpoint struct {
	ID      string `json:"id"`
	Address string `json:"address"`
}

Endpoint is a product API address.

type EndpointsResponse

type EndpointsResponse struct {
	// Endpoints contains the list of actual API addresses of Cloud.ru products.
	Endpoints []Endpoint `json:"endpoints"`
}

EndpointsResponse is a response from the Cloud.ru API.

func (*EndpointsResponse) Get

func (er *EndpointsResponse) Get(id string) *Endpoint

Get returns the API address of the product by its ID. If the product is not found, the function returns nil.

type Provider

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

func NewProvider

func NewProvider(ctx context.Context, cfg Config) (*Provider, error)

func (*Provider) CreateSecret

CreateSecret creates a Cloud.ru Secret Manager secret in the configured scope.

func (*Provider) Definition added in v0.2.0

func (p *Provider) Definition() contracts.ProviderDefinition

func (*Provider) GetSecretPayload

func (p *Provider) GetSecretPayload(ctx context.Context, key string) ([]byte, error)

func (*Provider) ListSecrets

func (p *Provider) ListSecrets(ctx context.Context) (map[string]contracts.Secret, error)

type RootFolder added in v0.2.0

type RootFolder string

func (*RootFolder) UnmarshalText added in v0.2.0

func (f *RootFolder) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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