license_manager

package
v0.0.0-...-b133c25 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArangoLicenseManagerEndpoint = "license.arango.ai"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	License(ctx context.Context, req LicenseRequest) (LicenseResponse, error)

	Registry(ctx context.Context) (RegistryResponse, error)
}

func NewClient

func NewClient(endpoint, id, key string, mods ...util.Mod[goHttp.Transport]) (Client, error)

func NewClientFromConn

func NewClientFromConn(conn driver.Connection) Client

type LicenseRequest

type LicenseRequest struct {
	DeploymentID *string                             `json:"deployment_id,omitempty"`
	TTL          *ugrpc.Object[*durationpb.Duration] `json:"ttl,omitempty"`
	Inventory    *ugrpc.Object[*inventory.Spec]      `json:"inventory,omitempty"`
}

type LicenseResponse

type LicenseResponse struct {
	ID      string                                `json:"id"`
	License string                                `json:"license"`
	Expires *ugrpc.Object[*timestamppb.Timestamp] `json:"expires,omitempty"`
}

type Registry

type Registry struct {
	Auths map[string]RegistryAuth `json:"auths,omitempty"`
}

func NewRegistryAuth

func NewRegistryAuth(endpoint, username, password string, stages ...Stage) (*Registry, error)

type RegistryAuth

type RegistryAuth struct {
	Client string `json:"client"`
	Auth   string `json:"auth,omitempty"`
}

type RegistryResponse

type RegistryResponse struct {
	Token string `json:"token"`
}

type Stage

type Stage int
const (
	StageUnknown Stage = iota
	StageDev
	StageQA
	StagePrd
)

func ParseStage

func ParseStage(s string) Stage

func ParseStages

func ParseStages(s ...string) []Stage

func (Stage) RegistryDomain

func (s Stage) RegistryDomain(domain string) (string, error)

Jump to

Keyboard shortcuts

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