contracts

package
v0.0.137 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: GPL-3.0 Imports: 5 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 Event added in v0.0.137

type Event interface {
	GetType() string
	GetTarget() string
	GetKind() string
	GetGroup() string
	GetName() string
	GetData() []byte
}

type Format added in v0.0.114

type Format interface {
	GetPrefix() string
	GetVersion() string
	GetCategory() string
	GetType() string
	GetKind() string
	GetGroup() string
	GetName() string
	Inverse() Format
	GetUUID() uuid.UUID
	ToString() string
	ToStringWithUUID() string
	Compliant() bool
	IsValid() bool
	ToBytes() []byte
}

type IDefinition added in v0.0.114

type IDefinition interface {
	FromJson([]byte) error
	SetRuntime(*commonv1.Runtime)
	GetRuntime() *commonv1.Runtime
	GetPrefix() string
	GetMeta() commonv1.Meta
	GetState() *commonv1.State
	SetState(*commonv1.State)
	GetKind() string
	ResolveReferences(ObjectInterface) ([]IDefinition, error)
	ToJson() ([]byte, error)
	ToJsonString() (string, error)
	Validate() (bool, error)
}

type Kind

type Kind interface {
	Start() error
	Apply(*authentication.User, []byte, string) (Response, error)
	Compare(*authentication.User, []byte) (Response, error)
	Delete(*authentication.User, []byte, string) (Response, error)
	GetShared() interface{}
	Event(events Event) error
}

type ObjectInterface added in v0.0.114

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

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
	GetPrefix() string
	GetMeta() commonv1.Meta
	GetState() *commonv1.State
	SetState(*commonv1.State)
	GetKind() string
	ResolveReferences(ObjectInterface) ([]IDefinition, error)
	ToJson() ([]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