keeper

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

M is global metric variable.

Functions

func NewQuerier

func NewQuerier(k Keeper) sdk.Querier

NewQuerier creates a new querier for execution clients.

Types

type Keeper

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

Keeper of the execution store

func NewKeeper

func NewKeeper(
	cdc *codec.Codec,
	key sdk.StoreKey,
	serviceKeeper types.ServiceKeeper,
	instanceKeeper types.InstanceKeeper,
	runnerKeeper types.RunnerKeeper,
	processKeeper types.ProcessKeeper,
	creditKeeper types.CreditKeeper,
) Keeper

NewKeeper creates a execution keeper

func (*Keeper) Create

func (k *Keeper) Create(ctx sdk.Context, msg types.MsgCreate) (*executionpb.Execution, error)

Create creates a new execution with proposed status. The execution reaches consensus only when more than 2/3 of emitters proposed the same execution. TODO: we should split the message and keeper function of execution create from user and for process.

func (*Keeper) Get

func (k *Keeper) Get(ctx sdk.Context, hash hash.Hash) (*executionpb.Execution, error)

Get returns the execution that matches given hash.

func (*Keeper) Import added in v0.25.1

func (k *Keeper) Import(ctx sdk.Context, execs []*executionpb.Execution) error

Import imports a list of executions into the store.

func (*Keeper) List

func (k *Keeper) List(ctx sdk.Context, filter types.ListFilter) ([]*executionpb.Execution, error)

List returns all executions.

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (*Keeper) Update

func (k *Keeper) Update(ctx sdk.Context, msg types.MsgUpdate) (*executionpb.Execution, error)

Update updates a new execution from definition.

type Metric

type Metric struct {
	Created    metrics.Counter
	InProgress metrics.Counter
	Updated    metrics.Counter
	Completed  metrics.Counter
}

Metric is struct to keep counters for execution statuses.

func NewMetric

func NewMetric() *Metric

NewMetric creates a counters metric.

Jump to

Keyboard shortcuts

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