memory

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Memory

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

Memory is implement datastore on-memory

func New

func New() (*Memory, error)

New create map

func (*Memory) CreateRunner

func (m *Memory) CreateRunner(ctx context.Context, runner datastore.Runner) error

CreateRunner add a runner

func (*Memory) CreateTarget

func (m *Memory) CreateTarget(ctx context.Context, target datastore.Target) error

CreateTarget create a target

func (*Memory) DeleteJob

func (m *Memory) DeleteJob(ctx context.Context, id uuid.UUID) error

DeleteJob delete a job

func (*Memory) DeleteRunner

func (m *Memory) DeleteRunner(ctx context.Context, id uuid.UUID, deletedAt time.Time, reason datastore.RunnerStatus) error

DeleteRunner delete a runner

func (*Memory) DeleteTarget

func (m *Memory) DeleteTarget(ctx context.Context, id uuid.UUID) error

DeleteTarget delete a target

func (*Memory) EnqueueJob

func (m *Memory) EnqueueJob(ctx context.Context, job datastore.Job) error

EnqueueJob add a job

func (*Memory) GetRunner

func (m *Memory) GetRunner(ctx context.Context, id uuid.UUID) (*datastore.Runner, error)

GetRunner get a runner

func (*Memory) GetTarget

func (m *Memory) GetTarget(ctx context.Context, id uuid.UUID) (*datastore.Target, error)

GetTarget get a target

func (*Memory) GetTargetByScope

func (m *Memory) GetTargetByScope(ctx context.Context, gheDomain, scope string) (*datastore.Target, error)

GetTargetByScope get a target from scope

func (*Memory) ListJobs

func (m *Memory) ListJobs(ctx context.Context) ([]datastore.Job, error)

ListJobs get all jobs

func (*Memory) ListRunners

func (m *Memory) ListRunners(ctx context.Context) ([]datastore.Runner, error)

ListRunners get a all runners

func (*Memory) ListTargets

func (m *Memory) ListTargets(ctx context.Context) ([]datastore.Target, error)

ListTargets get a all targets

func (*Memory) UpdateTargetStatus added in v1.3.0

func (m *Memory) UpdateTargetStatus(ctx context.Context, targetID uuid.UUID, newStatus datastore.TargetStatus, description string) error

UpdateTargetStatus update status in target

Jump to

Keyboard shortcuts

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