usecase

package
v0.0.0-...-aa75306 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MachineQuery

type MachineQuery map[string]string

MachineQuery indicate that the query to filter the machine instance.

func (MachineQuery) Match

func (q MachineQuery) Match(machine *models.Machine) bool

Match returns true if all factors in the query matches the machine.

type MachineUsecase

type MachineUsecase interface {
	// GetAllMachines returns all machines.
	GetAllMachines(ctx context.Context) ([]*models.Machine, error)
	// GetMachineByName returns the machine whose name is matched with the given name.
	GetMachineByName(ctx context.Context, name string) (*models.Machine, error)
	// GetMachineByQuery returns the machine which is filtered by given query.
	GetMachineByQuery(ctx context.Context, query *MachineQuery) ([]*models.Machine, error)
	// RegisterMachine register the machine if it has not been registered.
	RegisterOrUpdateMachine(ctx context.Context, machine *models.Machine) error
}

MachineUsecase is the interface to manipulate the machine data.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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