contracts

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: GPL-2.0 Imports: 0 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checksum

type Checksum interface {
	Equaler
	// String returns the string representation form of the Checksum.
	// The String method is used to use the Checksum in functions
	// where it needs to be compared or hashed.
	String() string
}

Checksum is a unique identifier of an entity.

type Checksumer

type Checksumer interface {
	Checksum() Checksum   // Checksum returns the Checksum.
	SetChecksum(Checksum) // SetChecksum sets the Checksum.
}

Checksumer is implemented by every entity with a checksum.

type Entity

type Entity interface {
	Fingerprinter
	IDer
}

Entity is implemented by every type Icinga DB should synchronize.

type EntityFactoryFunc

type EntityFactoryFunc func() Entity

EntityFactoryFunc knows how to create an Entity.

type Equaler

type Equaler interface {
	Equal(Equaler) bool // Equal checks for equality.
}

Equaler is implemented by every type that is comparable.

type Fingerprinter

type Fingerprinter interface {
	// Fingerprint returns the value that uniquely identifies the entity.
	Fingerprint() Fingerprinter
}

Fingerprinter is implemented by every entity that uniquely identifies itself.

type ID

type ID interface {
	// String returns the string representation form of the ID.
	// The String method is used to use the ID in functions
	// where it needs to be compared or hashed.
	String() string
}

ID is a unique identifier of an entity.

type IDer

type IDer interface {
	ID() ID   // ID returns the ID.
	SetID(ID) // SetID sets the ID.
}

IDer is implemented by every entity that uniquely identifies itself.

type Initer

type Initer interface {
	Init() // Init initializes the object.
}

Initer implements the Init method, which initializes the object in addition to zeroing.

type Scoper

type Scoper interface {
	Scope() interface{}
}

Scoper implements the Scope method, which returns a struct specifying the WHERE conditions that entities must satisfy in order to be SELECTed.

type TableNamer

type TableNamer interface {
	TableName() string // TableName tells the table.
}

TableNamer implements the TableName method, which returns the table of the object.

type Upserter

type Upserter interface {
	Upsert() interface{} // Upsert partitions the object.
}

Upserter implements the Upsert method, which returns a part of the object for ON DUPLICATE KEY UPDATE.

type Waiter

type Waiter interface {
	Wait() error // Wait waits for execution to complete.
}

Waiter implements the Wait method, which blocks until execution is complete.

type WaiterFunc

type WaiterFunc func() error

The WaiterFunc type is an adapter to allow the use of ordinary functions as Waiter. If f is a function with the appropriate signature, WaiterFunc(f) is a Waiter that calls f.

func (WaiterFunc) Wait

func (f WaiterFunc) Wait() error

Wait implements the Waiter interface.

Jump to

Keyboard shortcuts

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