pkg

package
v1.1.12 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Resources Resources `json:"resources" validate:"dive,keys,alphanum,endkeys,dive"`
	Root      string    `json:"root" validate:"startswith=/"`
}

func NewConfig

func NewConfig() Config

func (*Config) Read

func (config *Config) Read(filename string) error

func (Config) Validate

func (config Config) Validate() error

func (Config) Write

func (config Config) Write(filename string, perm os.FileMode) error

type Resource

type Resource struct {
	Mode  string `json:"mode,omitempty" validate:"required,number,max=4,startswith=0,excludesall=89"`
	Tmpfs bool   `json:"tmpfs,omitempty" validate:"required_with=Huge Size"`
	Huge  string `json:"huge,omitempty" validate:"omitempty,oneof=always never within_size"`
	Size  string `json:"size,omitempty" validate:"omitempty,min=2,max=4,endswith=%"`
}

type Resources

type Resources map[string]*Resource

func (Resources) Create

func (resources Resources) Create(root, name string) (string, error)

func (Resources) Get

func (resources Resources) Get(root string, name string) (string, error)

func (Resources) List

func (resources Resources) List(root string) (map[string]string, error)

func (Resources) Release

func (resources Resources) Release(root, name string) error

func (Resources) UnmarshalJSON

func (resources Resources) UnmarshalJSON(data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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