restoreservice

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 = "Restore 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 "Restore Service".

func NewDeleteEndpoint

func NewDeleteEndpoint(s Service) goa.Endpoint

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

func NewGetEndpoint

func NewGetEndpoint(s Service) goa.Endpoint

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

func NewUpdateEndpoint

func NewUpdateEndpoint(s Service) goa.Endpoint

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

func NewViewedRestoreresult

func NewViewedRestoreresult(res *Restoreresult, view string) *restoreserviceviews.Restoreresult

NewViewedRestoreresult initializes viewed result type Restoreresult from result type Restoreresult using the given view.

Types

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 Client

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

Client is the "Restore Service" service client.

func NewClient

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

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

func (*Client) Create

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

Create calls the "create" endpoint of the "Restore Service" service. Create may return the following errors:

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

func (*Client) Delete

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

Delete calls the "delete" endpoint of the "Restore Service" service.

func (*Client) Get

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

Get calls the "get" endpoint of the "Restore Service" service.

func (*Client) Update

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

Update calls the "update" endpoint of the "Restore Service" service.

type DeletePayload

type DeletePayload struct {
	ID *string
}

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

type Endpoints

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

Endpoints wraps the "Restore Service" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "Restore 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 "Restore Service" service endpoints.

type GetPayload

type GetPayload struct {
	ID *string
}

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

type Restore

type Restore struct {
	// Name of pachyderm instance to restore to
	Name *string
	// Namespace to restore to
	Namespace *string
	// Kubernetes secret containing S3 storage credentials
	StorageSecret *string
	// Key of backup tarball
	BackupLocation *string
}

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

type Restoreresult

type Restoreresult struct {
	CreatedAt *string
	UpdatedAt *string
	DeletedAt *string
	ID        *string
	// Name of pachyderm instance to restore to
	Name *string
	// Namespace to restore to
	Namespace *string
	// Key of backup tarball
	BackupLocation *string
	// Kubernetes secret containing S3 storage credentials
	StorageSecret *string
	// base64 encoded kubernetes object
	KubernetesResource *string
	// base64 encoded database dump
	Database *string
}

Restoreresult is the result type of the Restore Service service create method.

func NewRestoreresult

func NewRestoreresult(vres *restoreserviceviews.Restoreresult) *Restoreresult

NewRestoreresult initializes result type Restoreresult from viewed result type Restoreresult.

type Service

type Service interface {
	// New restore request
	Create(context.Context, *Restore) (res *Restoreresult, err error)
	// Get restore request
	Get(context.Context, *GetPayload) (res *Restoreresult, err error)
	// Update restore request
	Update(context.Context, *Restoreresult) (res *Restoreresult, err error)
	// Mark complete restore request
	Delete(context.Context, *DeletePayload) (res *Restoreresult, err error)
}

Service to handle restore requests

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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