types

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bid

type Bid struct {
	Id        BidId    `json:"bid_id"`
	Price     BidPrice `json:"price"`
	State     string   `json:"state,omitempty"`
	CreatedAt int64    `json:"created_at,omitempty"`
}

type BidId

type BidId struct {
	Owner    string `json:"owner"`
	Dseq     string `json:"dseq"`
	Gseq     string `json:"gseq"`
	Oseq     string `json:"oseq"`
	Provider string `json:"provider"`
}

type BidPrice

type BidPrice struct {
	Denom  string  `json:"denom"`
	Amount float32 `json:"amount,string"`
}

type BidWrapper

type BidWrapper struct {
	Bid Bid `json:"bid"`
}

type Bids

type Bids []Bid

func (Bids) FilterByMaxPrice

func (b Bids) FilterByMaxPrice(maxPrice float32, denom string) Bids

FilterByMaxPrice filters bids that are at or below the maximum price (in the same denomination)

func (Bids) FindAllByProviders

func (b Bids) FindAllByProviders(providers []string) Bids

FindAllByProviders finds all the Bid structures that have any of the given providers. It returns a slice of all the Bid structures where the providers were found.

func (Bids) FindByProvider

func (b Bids) FindByProvider(provider string) Bid

func (Bids) GetLowestPriceBid

func (b Bids) GetLowestPriceBid() *Bid

GetLowestPriceBid returns the bid with the lowest price from a list of bids

func (Bids) GetProviderAddresses

func (b Bids) GetProviderAddresses() []string

type BidsSliceWrapper

type BidsSliceWrapper struct {
	BidWrappers []BidWrapper `json:"bids"`
}

type Deployment

type Deployment struct {
	DeploymentInfo DeploymentInfo `json:"deployment"`
	EscrowAccount  EscrowAccount  `json:"escrow_account"`
}

type DeploymentCreateRequest

type DeploymentCreateRequest struct {
	SDL     string `json:"sdl"`
	Deposit int64  `json:"deposit"`
}

type DeploymentId

type DeploymentId struct {
	Dseq  string `json:"dseq"`
	Owner string `json:"owner"`
}

type DeploymentInfo

type DeploymentInfo struct {
	State        string       `json:"state"`
	DeploymentId DeploymentId `json:"deployment_id"`
	Hash         string       `json:"hash,omitempty"`       // SDL hash from deployment
	CreatedAt    int64        `json:"created_at,omitempty"` // Block height when deployment was created
}

type DeploymentResponse

type DeploymentResponse struct {
	Deployments []Deployment `json:"deployments"`
}

type EscrowAccount

type EscrowAccount struct {
	Owner   string               `json:"owner"`
	State   string               `json:"state"`
	Balance EscrowAccountBalance `json:"balance"`
}

type EscrowAccountBalance

type EscrowAccountBalance struct {
	Denom  string `json:"denom"`
	Amount string `json:"amount"`
}

type Provider

type Provider struct {
	Address    string            `json:"address"`
	Active     bool              `json:"active"`
	Uptime     float32           `json:"uptime"`
	Attributes map[string]string `json:"attributes"`
}

type SDL

type SDL struct {
	Version    string                        `yaml:"version"`
	Services   map[string]SDLService         `yaml:"services"`
	Profiles   SDLProfiles                   `yaml:"profiles"`
	Deployment map[string]SDLDeploymentGroup `yaml:"deployment"`
}

SDL represents the root structure of an Akash deployment manifest

type SDLComputeProfile

type SDLComputeProfile struct {
	Resources SDLResources `yaml:"resources"`
}

SDLComputeProfile defines the computational resources for a profile

type SDLDeploymentGroup

type SDLDeploymentGroup struct {
	Profile string `yaml:"profile"`
	Count   int    `yaml:"count"`
}

SDLDeploymentGroup defines the deployment configuration for a service

type SDLExposeSpec

type SDLExposeSpec struct {
	Port   int           `yaml:"port"`
	As     int           `yaml:"as,omitempty"`
	Accept []string      `yaml:"accept,omitempty"`
	To     []SDLExposeTo `yaml:"to,omitempty"`
	Proto  string        `yaml:"proto,omitempty"`
}

SDLExposeSpec defines how a service port should be exposed

type SDLExposeTo

type SDLExposeTo struct {
	Global bool `yaml:"global,omitempty"`
}

SDLExposeTo defines the exposure scope for a port

type SDLPlacementProfile

type SDLPlacementProfile struct {
	Attributes map[string]interface{} `yaml:"attributes,omitempty"`
	SignedBy   SDLSignedBy            `yaml:"signedBy,omitempty"`
	Pricing    map[string]SDLPricing  `yaml:"pricing"`
}

SDLPlacementProfile defines placement constraints and pricing

type SDLPricing

type SDLPricing struct {
	Amount int64 `yaml:"amount"`
}

SDLPricing defines pricing information for a service. Denom is fixed to uact under node v2 BME and is not part of the SDL spec.

type SDLProfiles

type SDLProfiles struct {
	Compute   map[string]SDLComputeProfile   `yaml:"compute"`
	Placement map[string]SDLPlacementProfile `yaml:"placement"`
}

SDLProfiles contains compute and placement profiles

type SDLResourceCPU

type SDLResourceCPU struct {
	Units string `yaml:"units"`
}

SDLResourceCPU defines CPU resource requirements

func (*SDLResourceCPU) UnmarshalYAML

func (c *SDLResourceCPU) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements custom YAML unmarshaling for CPU resources

type SDLResourceMemory

type SDLResourceMemory struct {
	Size string `yaml:"size"`
}

SDLResourceMemory defines memory resource requirements

func (*SDLResourceMemory) UnmarshalYAML

func (m *SDLResourceMemory) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements custom YAML unmarshaling for memory resources

type SDLResourceStorage

type SDLResourceStorage struct {
	Size  string `yaml:"size"`
	Class string `yaml:"class,omitempty"`
}

SDLResourceStorage defines storage resource requirements

func (*SDLResourceStorage) UnmarshalYAML

func (s *SDLResourceStorage) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements custom YAML unmarshaling for storage resources

type SDLResources

type SDLResources struct {
	CPU     SDLResourceCPU     `yaml:"cpu"`
	Memory  SDLResourceMemory  `yaml:"memory"`
	Storage SDLResourceStorage `yaml:"storage,omitempty"`
}

SDLResources defines the resource requirements

type SDLService

type SDLService struct {
	Image   string          `yaml:"image"`
	Command []string        `yaml:"command,omitempty"`
	Args    []string        `yaml:"args,omitempty"`
	Env     []string        `yaml:"env,omitempty"`
	Expose  []SDLExposeSpec `yaml:"expose,omitempty"`
}

SDLService defines a service within the SDL

type SDLSignedBy

type SDLSignedBy struct {
	AnyOf []string `yaml:"anyOf,omitempty"`
	AllOf []string `yaml:"allOf,omitempty"`
}

SDLSignedBy defines signing requirements for placement

type SDLStorage

type SDLStorage struct {
	Name  string `yaml:"name,omitempty"`
	Size  string `yaml:"size"`
	Class string `yaml:"class,omitempty"`
}

SDLStorage defines storage requirements

type Seqs

type Seqs struct {
	Dseq string
	Gseq string
	Oseq string
}

Seqs represents the sequence numbers returned from deployment operations

type Transaction

type Transaction struct {
	Height string           `json:"height"`
	Logs   []TransactionLog `json:"logs"`
	RawLog string           `json:"raw_log"`
}

type TransactionEvent

type TransactionEvent struct {
	Type       string                     `json:"type"`
	Attributes TransactionEventAttributes `json:"attributes"`
}

type TransactionEventAttribute

type TransactionEventAttribute struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type TransactionEventAttributes

type TransactionEventAttributes []TransactionEventAttribute

func (TransactionEventAttributes) Get

type TransactionLog

type TransactionLog struct {
	Events []TransactionEvent `json:"events"`
}

Jump to

Keyboard shortcuts

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