backupservice

package
v0.0.0-...-3febccf Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const ServiceName = "Backup Service"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [4]string{"create", "get", "update", "delete"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func NewCreateEndpoint

func NewCreateEndpoint(s Service) goa.Endpoint

NewCreateEndpoint returns an endpoint function that calls the method "create" of service "Backup Service".

func NewDeleteEndpoint

func NewDeleteEndpoint(s Service) goa.Endpoint

NewDeleteEndpoint returns an endpoint function that calls the method "delete" of service "Backup Service".

func NewGetEndpoint

func NewGetEndpoint(s Service) goa.Endpoint

NewGetEndpoint returns an endpoint function that calls the method "get" of service "Backup Service".

func NewUpdateEndpoint

func NewUpdateEndpoint(s Service) goa.Endpoint

NewUpdateEndpoint returns an endpoint function that calls the method "update" of service "Backup Service".

func NewViewedBackupresult

func NewViewedBackupresult(res *Backupresult, view string) *backupserviceviews.Backupresult

NewViewedBackupresult initializes viewed result type Backupresult from result type Backupresult using the given view.

Types

type Backup

type Backup struct {
	// Name of pachyderm instance backed up
	Name *string
	// Namespace of resource backed up
	Namespace *string
	// Name of target pod
	Pod *string
	// Name of container in pod
	Container *string
	// base64 encoded command to run in pod
	Command *string
	// Kubernetes secret containing S3 storage credentials
	StorageSecret *string
	// base64 encoded json representation of object
	KubernetesResource *string
}

Backup is the payload type of the Backup Service service create method.

type BackupNotFound

type BackupNotFound struct {
	// backup resource not found
	Message string
}

Backup not found error is returned when the backup is not found.

func (*BackupNotFound) Error

func (e *BackupNotFound) Error() string

Error returns an error description.

func (*BackupNotFound) ErrorName

func (e *BackupNotFound) ErrorName() string

ErrorName returns "BackupNotFound".

type Backupresult

type Backupresult struct {
	CreatedAt *string
	UpdatedAt *string
	DeletedAt *string
	ID        *string
	// Current state of the job
	State *string
	// Name of pachyderm instance backed up
	Name *string
	// Namespace of resource backed up
	Namespace *string
	// Name of target pod
	Pod *string
	// Name of container in pod
	Container *string
	// base64 encoded command to run in pod
	Command *string
	// Kubernetes secret containing S3 storage credentials
	StorageSecret *string
	// base64 encoded json representation of object
	KubernetesResource *string
	// URL of the uploaded backup tarball
	Location *string
}

Backupresult is the result type of the Backup Service service create method.

func NewBackupresult

func NewBackupresult(vres *backupserviceviews.Backupresult) *Backupresult

NewBackupresult initializes result type Backupresult from viewed result type Backupresult.

type Client

type Client struct {
	CreateEndpoint goa.Endpoint
	GetEndpoint    goa.Endpoint
	UpdateEndpoint goa.Endpoint
	DeleteEndpoint goa.Endpoint
}

Client is the "Backup Service" service client.

func NewClient

func NewClient(create, get, update, delete_ goa.Endpoint) *Client

NewClient initializes a "Backup Service" service client given the endpoints.

func (*Client) Create

func (c *Client) Create(ctx context.Context, p *Backup) (res *Backupresult, err error)

Create calls the "create" endpoint of the "Backup Service" service.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, p *DeletePayload) (res *Backupresult, err error)

Delete calls the "delete" endpoint of the "Backup Service" service. Delete may return the following errors:

  • "backup_not_found" (type *BackupNotFound): backup not found
  • error: internal error

func (*Client) Get

func (c *Client) Get(ctx context.Context, p *GetPayload) (res *Backupresult, err error)

Get calls the "get" endpoint of the "Backup Service" service. Get may return the following errors:

  • "backup_not_found" (type *BackupNotFound): backup not found
  • error: internal error

func (*Client) Update

func (c *Client) Update(ctx context.Context, p *Backupresult) (res *Backupresult, err error)

Update calls the "update" endpoint of the "Backup Service" service. Update may return the following errors:

  • "backup_not_found" (type *BackupNotFound): backup not found
  • error: internal error

type DeletePayload

type DeletePayload struct {
	ID *string
}

DeletePayload is the payload type of the Backup Service service delete method.

type Endpoints

type Endpoints struct {
	Create goa.Endpoint
	Get    goa.Endpoint
	Update goa.Endpoint
	Delete goa.Endpoint
}

Endpoints wraps the "Backup Service" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "Backup Service" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "Backup Service" service endpoints.

type GetPayload

type GetPayload struct {
	ID *string
}

GetPayload is the payload type of the Backup Service service get method.

type Service

type Service interface {
	// New backup request
	Create(context.Context, *Backup) (res *Backupresult, err error)
	// Obtain backup request
	Get(context.Context, *GetPayload) (res *Backupresult, err error)
	// Update backup request
	Update(context.Context, *Backupresult) (res *Backupresult, err error)
	// Mark complete backup request
	Delete(context.Context, *DeletePayload) (res *Backupresult, err error)
}

Service to handle backup requests

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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