domain

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CloudPodStatusStarting    = "starting"
	CloudPodStatusCreating    = "creating"
	CloudPodStatusFailed      = "failed"
	CloudPodStatusRunning     = "running"
	CloudPodStatusTerminated  = "terminated"
	CloudPodStatusTerminating = "terminating"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessURL

type AccessURL interface {
	AccessURL() string
}

AccessURL

func NewAccessURL

func NewAccessURL(v string) (AccessURL, error)

type Cloud

type Cloud struct {
	CloudConf

	SingleRemain CloudRemain
	MultiRemain  CloudRemain
}

func (*Cloud) HasMultiCardsIdle added in v1.3.0

func (c *Cloud) HasMultiCardsIdle(deduction int) bool

func (*Cloud) HasSingleCardIdle added in v1.3.0

func (c *Cloud) HasSingleCardIdle() bool

type CloudConf

type CloudConf struct {
	Id            string
	Name          CloudName
	Specs         []CloudSpec
	Images        []CloudImage
	Feature       CloudFeature
	Processor     CloudProcessor
	SingleLimited CloudLimited
	MultiLimited  CloudLimited
	Credit        Credit
}

func (*CloudConf) GetImage added in v1.1.1

func (c *CloudConf) GetImage(alias string) (ICloudImage, error)

func (*CloudConf) GetImageAlias added in v1.3.0

func (c *CloudConf) GetImageAlias(image string) (CloudImageAlias, error)

func (*CloudConf) GetSpecDesc added in v1.3.0

func (c *CloudConf) GetSpecDesc(cardsNum int) (CloudSpecDesc, error)

func (*CloudConf) IsNPU

func (c *CloudConf) IsNPU() bool

type CloudFeature

type CloudFeature interface {
	CloudFeature() string
}

CloudFeature

func NewCloudFeature

func NewCloudFeature(v string) (CloudFeature, error)

type CloudImage

type CloudImage struct {
	Alias CloudImageAlias
	Image ICloudImage
}

type CloudImageAlias added in v1.1.1

type CloudImageAlias interface {
	CloudImageAlias() string
}

func NewCloudImageAlias added in v1.1.1

func NewCloudImageAlias(v string) (CloudImageAlias, error)

type CloudLimited

type CloudLimited interface {
	CloudLimited() int
}

CloudLimited

func NewCloudLimited

func NewCloudLimited(v int) (CloudLimited, error)

type CloudName

type CloudName interface {
	CloudName() string
}

CloudName

func NewCloudName

func NewCloudName(v string) (CloudName, error)

type CloudProcessor

type CloudProcessor interface {
	CloudProcessor() string
}

CloudProcessor

func NewCloudProcessor

func NewCloudProcessor(v string) (CloudProcessor, error)

type CloudRemain

type CloudRemain interface {
	CloudRemain() int
}

CloudRemain

func NewCloudRemain

func NewCloudRemain(v int) (CloudRemain, error)

type CloudSpec

type CloudSpec struct {
	Desc     CloudSpecDesc
	CardsNum CloudSpecCardsNum
}

type CloudSpecCardsNum added in v1.3.0

type CloudSpecCardsNum interface {
	CloudSpecCardsNum() int
}

CloudSpecCardsNum

func NewCloudSpecCardsNum added in v1.3.0

func NewCloudSpecCardsNum(v int) (CloudSpecCardsNum, error)

type CloudSpecDesc added in v1.3.0

type CloudSpecDesc interface {
	CloudSpecDesc() string
}

CloudSpec

func NewCloudSpecDesc added in v1.3.0

func NewCloudSpecDesc(v string) (CloudSpecDesc, error)

type Credit

type Credit interface {
	Credit() int64
}

Credit

func NewCredit

func NewCredit(v int64) (Credit, error)

type ICloudImage added in v1.1.1

type ICloudImage interface {
	Image() string
}

func NewICloudImage added in v1.1.1

func NewICloudImage(v string) (ICloudImage, error)

type Pod

type Pod struct {
	Id      string
	CloudId string
	Owner   otypes.Account
	Image   string
}

func (*Pod) IsOnwer

func (r *Pod) IsOnwer(owner otypes.Account) bool

type PodError

type PodError interface {
	PodError() string
	IsGood() bool
}

PodError

func NewPodError

func NewPodError(v string) (PodError, error)

type PodExpiry

type PodExpiry interface {
	PodExpiry() int64
	PodExpiryDate() string
}

PodExpiry

func NewPodExpiry

func NewPodExpiry(v int64) (PodExpiry, error)

type PodInfo

type PodInfo struct {
	Pod

	Status    PodStatus
	Expiry    PodExpiry
	Error     PodError
	AccessURL AccessURL
	CreatedAt types.Time
	CardsNum  CloudSpecCardsNum
}

func (*PodInfo) CanRelease

func (p *PodInfo) CanRelease() bool

func (*PodInfo) CheckGoodAndSet

func (p *PodInfo) CheckGoodAndSet() bool

func (*PodInfo) GetCloudType

func (p *PodInfo) GetCloudType() string

func (*PodInfo) IsAscend

func (p *PodInfo) IsAscend() bool

func (*PodInfo) IsCpu

func (p *PodInfo) IsCpu() bool

func (*PodInfo) IsExpiried

func (p *PodInfo) IsExpiried() bool

func (*PodInfo) IsFailedOrTerminated

func (p *PodInfo) IsFailedOrTerminated() bool

func (*PodInfo) IsHoldingAndNotExpiried

func (p *PodInfo) IsHoldingAndNotExpiried() bool

func (*PodInfo) IsTerminated

func (p *PodInfo) IsTerminated() bool

func (*PodInfo) IsTerminating

func (p *PodInfo) IsTerminating() bool

func (*PodInfo) SetDefaultExpiry

func (p *PodInfo) SetDefaultExpiry() (err error)

func (*PodInfo) SetStartingPodInfo

func (p *PodInfo) SetStartingPodInfo(
	cid string, owner otypes.Account, image ICloudImage, cardsNum CloudSpecCardsNum,
) (err error)

func (*PodInfo) SetStatus

func (p *PodInfo) SetStatus()

func (*PodInfo) StatusSetCreating

func (p *PodInfo) StatusSetCreating()

func (*PodInfo) StatusSetFailed

func (p *PodInfo) StatusSetFailed()

func (*PodInfo) StatusSetRunning

func (p *PodInfo) StatusSetRunning()

func (*PodInfo) StatusSetTerminated

func (p *PodInfo) StatusSetTerminated()

func (*PodInfo) StatusSetTerminating

func (p *PodInfo) StatusSetTerminating()

type PodStatus

type PodStatus interface {
	PodStatus() string
	IsStarting() bool
	IsCreating() bool
	IsFailed() bool
	IsRunning() bool
	IsTerminated() bool
	IsTerminating() bool
}

PodStatus

func NewPodStatus

func NewPodStatus(v string) (PodStatus, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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