cloudru

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Apache-2.0 Imports: 21 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"`
}

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, providerMetrics metrics.Provider) (*Provider, error)

func (*Provider) CreateSecret

func (p *Provider) CreateSecret(ctx context.Context, secret contracts.Secret, payload []byte) error

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)

Jump to

Keyboard shortcuts

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