exec

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REQUEST_STATUS_READY   string = "Ready"
	REQUEST_STATUS_FAILED  string = "Failed"
	REQUEST_STATUS_OK      string = "Succeeded"
	REQUEST_STATUS_RUNNING string = "Running"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BookKeeper

type BookKeeper struct {
	Requests RequestKeeper
}

func NewInMemBookKeeper

func NewInMemBookKeeper() (*BookKeeper, *util.Result)

func (*BookKeeper) AsyncRun

func (k *BookKeeper) AsyncRun(req Request)

func (*BookKeeper) Register

func (k *BookKeeper) Register(req Request) (*RequestMeta, *util.Result)

type InMemRequestKeeper

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

func NewInMemRequestKeeper

func NewInMemRequestKeeper() *InMemRequestKeeper

func (*InMemRequestKeeper) Get

func (k *InMemRequestKeeper) Get(reqId string) (*RequestMeta, bool)

func (*InMemRequestKeeper) Set

func (k *InMemRequestKeeper) Set(req *RequestMeta)

type Request

type Request interface {
	ID() string
	Name() string
	Logger() *zerolog.Logger
	Run() (bool, []*util.Result)
}

type RequestKeeper

type RequestKeeper interface {
	Get(reqId string) (*RequestMeta, bool)
	Set(req *RequestMeta)
}

type RequestMeta

type RequestMeta struct {
	RequestID string         `json:"request_id,omitempty" yaml:"request_id,omitempty" bson:"request_id,omitempty"`
	FuncName  string         `json:"func_name,omitempty" yaml:"func_name,omitempty" bson:"func_name,omitempty"`
	Results   []*util.Result `json:"results,omitempty" yaml:"result,omitempty" bson:"results,omitempty"`
	Status    string         `json:"status,omitempty" yaml:"status,omitempty" bson:"status,omitempty"`
}

func (*RequestMeta) Reset

func (meta *RequestMeta) Reset(req Request)

Jump to

Keyboard shortcuts

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