model

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2023 License: AGPL-3.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validator

func Validator(model FHub) error

Types

type Build

type Build struct {
	Local     *Local     `validate:"required_without=Container"`
	Container *Container `validate:"required_without=Local"`
}

func (*Build) DeepCopy

func (in *Build) DeepCopy() (out *Build)

type Container

type Container struct {
	Image         string `validate:"required_without=ContainerFile"`
	ContainerFile string `validate:"required_without=Image"`
	Source        string `validate:"required"`
}

func (*Container) DeepCopy

func (in *Container) DeepCopy() (out *Container)

type FHub

type FHub struct {
	// Function namespace
	Name string `validate:"required"`
	// Function version
	Version string `validate:"required"`
	// FHub schema version
	SpecVersion string `validate:"required"`
	Build       Build
	Serving     Serving
	Functions   map[string]Function `validate:"min=1,dive"`
}

func UnmarshalBytes

func UnmarshalBytes(data []byte) (FHub, error)

func UnmarshalFile

func UnmarshalFile(path string) (FHub, error)

func UnmarshalHttp

func UnmarshalHttp(url string) (FHub, error)

func UnmarshalString

func UnmarshalString(data string) (FHub, error)

func (*FHub) DeepCopy

func (in *FHub) DeepCopy() (out *FHub)

type Function

type Function struct {
	Inputs  []string `validate:"min=1"`
	Outputs []string `validate:"min=1"`
	// contains filtered or unexported fields
}

func (*Function) Unmarshal

func (f *Function) Unmarshal(field string, value cue.Value) (err error)

func (Function) UnmarshalInput added in v0.0.8

func (f Function) UnmarshalInput(data []byte) (map[string]any, error)

func (Function) UnmarshalOutput added in v0.0.8

func (f Function) UnmarshalOutput(data []byte) (map[string]any, error)

func (Function) ValidateInput

func (f Function) ValidateInput(data []byte) error

func (Function) ValidateOutput

func (f Function) ValidateOutput(data []byte) error

type Grpc

type Grpc struct {
	Proto string `validate:"required"`
}

func (*Grpc) DeepCopy

func (in *Grpc) DeepCopy() (out *Grpc)

type Http

type Http struct {
	Url string `validate:"required"`
}

func (*Http) DeepCopy

func (in *Http) DeepCopy() (out *Http)

type Local

type Local struct {
	Source string `validate:"required"`
}

func (*Local) DeepCopy

func (in *Local) DeepCopy() (out *Local)

type Parameter added in v0.0.7

type Parameter struct {
	Label string
	// contains filtered or unexported fields
}

func (*Parameter) Type added in v0.0.7

func (f *Parameter) Type(k reflect.Kind) bool

type Serving

type Serving struct {
	Http *Http
	Grpc *Grpc
}

func (*Serving) DeepCopy

func (in *Serving) DeepCopy() (out *Serving)

type Unmarshaler

type Unmarshaler interface {
	Unmarshal(field string, value cue.Value) (err error)
}

type ValidatorCtxValueKey

type ValidatorCtxValueKey string
const ValidatorCtxValue ValidatorCtxValueKey = "value"

Jump to

Keyboard shortcuts

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