contracts

package
v0.0.129 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: GPL-3.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Control added in v0.0.73

type Control struct {
	Kind      string
	Operation string
	Group     string
	Name      string

	User *authentication.User
	Data map[string]any
}

type Format added in v0.0.114

type Format interface {
	GetCategory() string
	GetType() string
	GetUUID() uuid.UUID
	ToString() string
	ToStringWithUUID() string
	Full() bool
	IsValid() bool
	ToBytes() []byte
}

type IDefinition added in v0.0.114

type IDefinition interface {
	FromJson([]byte) error
	SetRuntime(*commonv1.Runtime)
	GetRuntime() *commonv1.Runtime
	GetKind() string
	ResolveReferences(ObjectInterface) ([]IDefinition, error)
	ToJson() ([]byte, error)
	ToJsonWithKind() ([]byte, error)
	ToJsonString() (string, error)
	Validate() (bool, error)
}

type Kind

type Kind interface {
	Start() error
	Propose(*gin.Context, *authentication.User, []byte, string) (Response, error)
	Apply(*authentication.User, []byte, string) (Response, error)
	Compare(*authentication.User, []byte) (Response, error)
	Delete(*authentication.User, []byte, string) (Response, error)
	GetShared() interface{}
	Run(string, Control) Response
}

type ObjectInterface added in v0.0.114

type ObjectInterface interface {
	GetDefinitionString() string
	GetDefinition() map[string]any
	GetDefinitionByte() []byte
	Propose(Format, []byte) (uuid.UUID, error)
	Wait(uuid uuid.UUID) error
	AddLocal(format Format, data []byte) error
	RemoveLocal(format Format) (bool, error)
	Find(format Format) error
	FindMany(format Format) (map[string]ObjectInterface, error)
	Diff(definition []byte) bool
	GetDiff() []diff.Change
	Exists() bool
	ChangeDetected() bool
}

type PlatformEvent added in v0.0.114

type PlatformEvent struct {
	NetworkID   string
	ContainerID string
	Group       string
	Name        string
	Managed     bool
	Type        string
}

type Response added in v0.0.73

type Response struct {
	HttpStatus       int
	Explanation      string
	ErrorExplanation string
	Error            bool
	Success          bool
	Data             json.RawMessage
}

type TDefinition added in v0.0.114

type TDefinition interface {
	Apply(Format, ObjectInterface, string) (ObjectInterface, error)
	Delete(Format, ObjectInterface, string) (IDefinition, error)
	Changed(Format, ObjectInterface) (bool, error)
	FromJson([]byte) error
	SetRuntime(*commonv1.Runtime)
	GetRuntime() *commonv1.Runtime
	GetKind() string
	ResolveReferences(ObjectInterface) ([]IDefinition, error)
	ToJson() ([]byte, error)
	ToJsonWithKind() ([]byte, error)
	ToJsonString() (string, error)
	Validate() (bool, error)
}

Jump to

Keyboard shortcuts

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