model

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorCodeConflict = 409
	ErrorCodeNotFound = 404
)

Variables

This section is empty.

Functions

func IsKeyConflict

func IsKeyConflict(err error) bool

IsKeyConflict returns true if the error code is ErrorCodeConflict = 409.

func IsKeyNotFound

func IsKeyNotFound(err error) bool

IsKeyNotFound returns true if the error code is ErrorCodeNotFound.

Types

type DAO

type DAO interface {
	io.Closer
	Init() error
	IsCaseSensitive() bool
	Create(entity modelAPI.Entity) error
	Upsert(entity modelAPI.Entity) error
	// Get will find a unique object. It will depend on the implementation to generate the key based on the kind and the metadata.
	// entity is the object that will be used by the method to set the value returned by the database.
	Get(kind modelV1.Kind, metadata modelAPI.Metadata, entity modelAPI.Entity) error
	// Query will find a list of resource that is matching the query passed in parameter. The list found will be set in slice.
	// slice is an interface for casting simplification. But slice must be a pointer to a slice of modelAPI.Metadata
	Query(query Query, slice interface{}) error
	Delete(kind modelV1.Kind, metadata modelAPI.Metadata) error
	DeleteByQuery(query Query) error
	HealthCheck() bool
	GetLatestUpdateTime(kind []modelV1.Kind) (*string, error)
}

type Error

type Error struct {
	Key  string
	Code int
}

func (*Error) Error

func (e *Error) Error() string

type Query

type Query interface {
}

Jump to

Keyboard shortcuts

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