fake

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package fake contains a fake client wrapper for Tinkerbell.

Package fake contains a fake client wrapper for Tinkerbell.

Package fake contains a fake client wrapper for Tinkerbell.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hardware

type Hardware struct {
	Objs map[string]*hardware.Hardware
}

Hardware is a fake client for Tinkerbell Hardwares.

func NewFakeHardwareClient

func NewFakeHardwareClient(objs ...*hardware.Hardware) *Hardware

NewFakeHardwareClient returns a new fake client.

func (*Hardware) Create

func (f *Hardware) Create(ctx context.Context, in *hardware.Hardware) error

Create creates a new Hardware.

func (*Hardware) Delete

func (f *Hardware) Delete(ctx context.Context, id string) error

Delete deletes a Hardware from Tinkerbell.

func (*Hardware) Get

func (f *Hardware) Get(ctx context.Context, id, ip, mac string) (*hardware.Hardware, error)

Get gets a Hardware from Tinkerbell.

func (*Hardware) Update

func (f *Hardware) Update(ctx context.Context, in *hardware.Hardware) error

Update Hardware in Tinkerbell.

type Template

type Template struct {
	Objs map[string]*template.WorkflowTemplate
}

Template is a fake client for Tinkerbell Templates.

func NewFakeTemplateClient

func NewFakeTemplateClient(objs ...*template.WorkflowTemplate) *Template

NewFakeTemplateClient returns a new fake client.

func (*Template) Create

func (f *Template) Create(ctx context.Context, in *template.WorkflowTemplate) error

Create creates a new Template.

func (*Template) Delete

func (f *Template) Delete(ctx context.Context, id string) error

Delete deletes a Template from Tinkerbell.

func (*Template) Get

func (f *Template) Get(ctx context.Context, id, name string) (*template.WorkflowTemplate, error)

Get gets a Template from Tinkerbell.

func (*Template) Update

func (f *Template) Update(ctx context.Context, in *template.WorkflowTemplate) error

Update updates a Template from Tinkerbell.

type Workflow

type Workflow struct {
	Objs map[string]*workflow.Workflow
	// contains filtered or unexported fields
}

Workflow is a fake client for Tinkerbell Workflows.

func NewFakeWorkflowClient

func NewFakeWorkflowClient(hwClient Hardware, templateClient Template, objs ...*workflow.Workflow) *Workflow

NewFakeWorkflowClient returns a new fake client.

func (*Workflow) Create

func (f *Workflow) Create(ctx context.Context, templateID, hardwareID string) (string, error)

Create creates a new Workflow.

func (*Workflow) Delete

func (f *Workflow) Delete(ctx context.Context, id string) error

Delete deletes a Workflow from Tinkerbell.

func (*Workflow) Get

func (f *Workflow) Get(ctx context.Context, id string) (*workflow.Workflow, error)

Get gets a Workflow from Tinkerbell.

Jump to

Keyboard shortcuts

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