store

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	gorm.Model

	EngineID string `gorm:"uniqueIndex"`

	TenantID string `gorm:"index"`

	// PodName is name of the pods where the engine is connecting to.
	PodName string

	// PodIP is the IP address of the pods where the engine is connecting to.
	PodIP string

	// Status is a marshaled data of the EngineStatus proto message.
	Status []byte

	IsReady bool

	// LastStatusUpdatedAt is the Unix nanoseconds when the status was updated last time.
	LastStatusUpdatedAt int64
}

Engine models the engine.

type S

type S struct {
	// contains filtered or unexported fields
}

S represents the data store.

func New

func New(db *gorm.DB) *S

New creates a new store instance.

func NewTest

func NewTest(t *testing.T) (*S, func())

NewTest returns a new test store.

func (*S) AutoMigrate

func (s *S) AutoMigrate() error

AutoMigrate sets up the auto-migration task of the database.

func (*S) CreateOrUpdateEngine

func (s *S) CreateOrUpdateEngine(engine *Engine) error

CreateOrUpdateEngine creates or updates the engine.

func (*S) DeleteEngine

func (s *S) DeleteEngine(engineID string) error

DeleteEngine deletes the engine of the ID.

func (*S) ListEnginesByTenantID

func (s *S) ListEnginesByTenantID(tenantID string) ([]*Engine, error)

ListEnginesByTenantID lists engines by tenant ID.

Jump to

Keyboard shortcuts

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