validation

package
v0.9.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidManifest         = errors.New("invalid manifest")
	ErrServiceExposePortZero   = errors.New("The service port is zero")
	ErrManifestCrossValidation = errors.New("manifest cross validation error")
)

Functions

func ValidateManifest

func ValidateManifest(m manifest.Manifest) error

ValidateManifest does validation for manifest

func ValidateManifestWithDeployment

func ValidateManifestWithDeployment(m *manifest.Manifest, dgroups []dtypes.Group) error

func ValidateManifestWithGroupSpecs

func ValidateManifestWithGroupSpecs(m *manifest.Manifest, gspecs []*dtypes.GroupSpec) error

Types

type ValConfig added in v0.6.5

type ValConfig struct {
	MaxUnitCPU     uint `env:"AKASH_MAX_UNIT_CPU"     envDefault:"500"`
	MaxUnitMemory  uint `env:"AKASH_MAX_UNIT_MEMORY"  envDefault:"1073741824"` // 1Gi
	MaxUnitStorage uint `env:"AKASH_MAX_UNIT_STORAGE" envDefault:"1073741824"` // 1Gi
	MaxUnitCount   uint `env:"AKASH_MAX_UNIT_COUNT"   envDefault:"10"`
	MaxUnitPrice   uint `env:"AKASH_MAX_UNIT_PRICE"   envDefault:"10000"`

	MinUnitCPU     uint `env:"AKASH_MIN_UNIT_CPU"      envDefault:"10"`
	MinUnitMemory  uint `env:"AKASH_MIN_UNIT_MEMORY"   envDefault:"1024"` // 1Mi
	MinUnitStorage uint `env:"AKASH_MIN_UNIT_STORAGE"  envDefault:"1024"` // 1Mi
	MinUnitCount   uint `env:"AKASH_MIN_UNIT_COUNT"    envDefault:"1"`
	MinUnitPrice   uint `env:"AKASH_MIN_UNIT_PRICE"    envDefault:"1"`

	MaxGroupCount int `env:"AKASH_MAX_GROUP_COUNT" envDefault:"10"`
	MaxGroupUnits int `env:"AKASH_MAX_GROUP_UNITS" envDefault:"10"`

	MaxGroupCPU     int64 `env:"AKASH_MAX_GROUP_CPU"       envDefault:"1000"`
	MaxGroupMemory  int64 `env:"AKASH_MAX_GROUP_MEMORY"    envDefault:"1073741824"` // 1Gi
	MaxGroupStorage int64 `env:"AKASH_MAX_GROUP_STORAGE"   envDefault:"5368709120"` // 5Gi

	MinGroupMemPrice int64 `env:"AKASH_MEM_PRICE_MIN" envDefault:"50"`
	MaxGroupMemPrice int64 `env:"AKASH_MEM_PRICE_MAX" envDefault:"1048576"`
}

ValConfig represents validation config

func Config added in v0.3.1

func Config() ValConfig

Config returns default configuration

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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