domain

package
v0.0.72 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContextKeyClientIdentifier contextKey = "clientIdentifier"
	ContextKeyDepth            contextKey = "depth"
	ContextKeyMsgId            contextKey = "msgId"
)

Variables

View Source
var EventValues = []any{"newChecksum", "objectAdded", "objectDeleted", "objectModified", "getObject", "patchObject", "putObject", "ping", "batch"}

Functions

func ToResourceVersion added in v0.0.47

func ToResourceVersion(version string) int

Types

type Batch added in v0.0.47

type Batch struct {
	Depth                int
	Event                *Event
	MsgId                string
	Kind                 *Kind
	BatchType            string
	Items                *BatchItems
	AdditionalProperties map[string]interface{}
}

Batch represents a Batch model.

type BatchItems added in v0.0.47

type BatchItems struct {
	PutObject            []PutObject
	NewChecksum          []NewChecksum
	ObjectDeleted        []ObjectDeleted
	GetObject            []GetObject
	PatchObject          []PatchObject
	AdditionalProperties map[string]interface{}
}

BatchItems represents a BatchItems model.

func (BatchItems) Length added in v0.0.47

func (items BatchItems) Length() int

type BatchType added in v0.0.47

type BatchType string
const (
	DefaultBatch        BatchType = ""
	ReconciliationBatch BatchType = "reconciliation"
)

type Callbacks

type Callbacks struct {
	DeleteObject func(ctx context.Context, id KindName) error
	GetObject    func(ctx context.Context, id KindName, baseObject []byte) error
	PatchObject  func(ctx context.Context, id KindName, checksum string, patch []byte) error
	PutObject    func(ctx context.Context, id KindName, object []byte) error
	VerifyObject func(ctx context.Context, id KindName, checksum string) error
	Batch        func(ctx context.Context, kind Kind, batchType BatchType, items BatchItems) error
}

type ClientIdentifier added in v0.0.5

type ClientIdentifier struct {
	Account        string
	Cluster        string
	ConnectionId   string
	ConnectionTime time.Time
	HelmVersion    string
	Version        string
}

func (ClientIdentifier) ConnectionString added in v0.0.40

func (c ClientIdentifier) ConnectionString() string

func (ClientIdentifier) String added in v0.0.5

func (c ClientIdentifier) String() string

type Event

type Event uint

Event represents an enum of Event.

const (
	EventNewChecksum Event = iota
	EventObjectAdded
	EventObjectDeleted
	EventObjectModified
	EventGetObject
	EventPatchObject
	EventPutObject
	EventPing
	EventBatch
)

func (Event) Value

func (op Event) Value() any

Value returns the value of the enum.

type Generic

type Generic struct {
	Depth                int
	Event                *Event
	Kind                 *Kind
	MsgId                string
	AdditionalProperties map[string]interface{}
}

Generic represents a Generic model.

type GetObject

type GetObject struct {
	ResourceVersion      int
	BaseObject           string
	Depth                int
	Event                *Event
	Kind                 *Kind
	MsgId                string
	Name                 string
	Namespace            string
	AdditionalProperties map[string]interface{}
}

GetObject represents a GetObject model.

type Kind

type Kind struct {
	Group                string
	Version              string
	Resource             string
	AdditionalProperties map[string]interface{}
}

Kind represents a Kind model.

func KindFromString added in v0.0.5

func KindFromString(ctx context.Context, kind string) *Kind

func (Kind) String

func (k Kind) String() string

Kind returns group/version/resource as a string.

type KindName added in v0.0.5

type KindName struct {
	Kind            *Kind
	Name            string
	Namespace       string
	ResourceVersion int
}

func FromUnstructured added in v0.0.67

func FromUnstructured(u *unstructured.Unstructured) KindName

func (KindName) String added in v0.0.5

func (c KindName) String() string

func (KindName) ToCustomProperties added in v0.0.67

func (c KindName) ToCustomProperties() map[string]string

type NewChecksum

type NewChecksum struct {
	ResourceVersion      int
	Checksum             string
	Depth                int
	Event                *Event
	Kind                 *Kind
	MsgId                string
	Name                 string
	Namespace            string
	AdditionalProperties map[string]interface{}
}

NewChecksum represents a NewChecksum model.

type ObjectDeleted

type ObjectDeleted struct {
	ResourceVersion      int
	Depth                int
	Event                *Event
	Kind                 *Kind
	MsgId                string
	Name                 string
	Namespace            string
	AdditionalProperties map[string]interface{}
}

ObjectDeleted represents a ObjectDeleted model.

type PatchObject

type PatchObject struct {
	Checksum             string
	ResourceVersion      int
	Depth                int
	Event                *Event
	Kind                 *Kind
	MsgId                string
	Name                 string
	Namespace            string
	Patch                string
	AdditionalProperties map[string]interface{}
}

PatchObject represents a PatchObject model.

type PutObject

type PutObject struct {
	ResourceVersion      int
	Depth                int
	Event                *Event
	Kind                 *Kind
	MsgId                string
	Name                 string
	Namespace            string
	Object               string
	AdditionalProperties map[string]interface{}
}

PutObject represents a PutObject model.

type Strategy

type Strategy string
const (
	CopyStrategy  Strategy = "copy"
	PatchStrategy Strategy = "patch"
)

Jump to

Keyboard shortcuts

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