validation

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoGroupsPresent = errors.New("validation: no groups present")
	ErrGroupEmptyName  = errors.New("validation: group has empty name")
)

Functions

func ValidateDeploymentGroup added in v0.3.1

func ValidateDeploymentGroup(gspec dtypes.GroupSpec) error

ValidateDeploymentGroup does validation for provided deployment group

func ValidateDeploymentGroups

func ValidateDeploymentGroups(gspecs []dtypes.GroupSpec) error

ValidateDeploymentGroups does validation for all deployment groups

func ValidateManifest

func ValidateManifest(m manifest.Manifest) error

ValidateManifest does validation for manifest

func ValidateManifestWithDeployment

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

ValidateManifestWithDeployment does basic validation and returns nil

func ValidateManifestWithGroupSpecs

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

ValidateManifestWithGroupSpecs does validation for manifest with group specifications

func ValidateResourceList added in v0.3.1

func ValidateResourceList(rlist types.ResourceGroup) error

ValidateResourceList does basic validation for resources list

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

Jump to

Keyboard shortcuts

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