server

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBackupServicePath

func CreateBackupServicePath() string

CreateBackupServicePath returns the URL path to the Backup Service service create HTTP endpoint.

func DecodeCreateRequest

func DecodeCreateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeCreateRequest returns a decoder for requests sent to the Backup Service create endpoint.

func DecodeDeleteRequest

func DecodeDeleteRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeDeleteRequest returns a decoder for requests sent to the Backup Service delete endpoint.

func DecodeGetRequest

func DecodeGetRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeGetRequest returns a decoder for requests sent to the Backup Service get endpoint.

func DecodeUpdateRequest

func DecodeUpdateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeUpdateRequest returns a decoder for requests sent to the Backup Service update endpoint.

func DeleteBackupServicePath

func DeleteBackupServicePath(id string) string

DeleteBackupServicePath returns the URL path to the Backup Service service delete HTTP endpoint.

func EncodeCreateResponse

func EncodeCreateResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeCreateResponse returns an encoder for responses returned by the Backup Service create endpoint.

func EncodeDeleteError

func EncodeDeleteError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeDeleteError returns an encoder for errors returned by the delete Backup Service endpoint.

func EncodeDeleteResponse

func EncodeDeleteResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeDeleteResponse returns an encoder for responses returned by the Backup Service delete endpoint.

func EncodeGetError

func EncodeGetError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeGetError returns an encoder for errors returned by the get Backup Service endpoint.

func EncodeGetResponse

func EncodeGetResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeGetResponse returns an encoder for responses returned by the Backup Service get endpoint.

func EncodeUpdateError

func EncodeUpdateError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeUpdateError returns an encoder for errors returned by the update Backup Service endpoint.

func EncodeUpdateResponse

func EncodeUpdateResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeUpdateResponse returns an encoder for responses returned by the Backup Service update endpoint.

func GetBackupServicePath

func GetBackupServicePath(id string) string

GetBackupServicePath returns the URL path to the Backup Service service get HTTP endpoint.

func Mount

func Mount(mux goahttp.Muxer, h *Server)

Mount configures the mux to serve the Backup Service endpoints.

func MountCreateHandler

func MountCreateHandler(mux goahttp.Muxer, h http.Handler)

MountCreateHandler configures the mux to serve the "Backup Service" service "create" endpoint.

func MountDeleteHandler

func MountDeleteHandler(mux goahttp.Muxer, h http.Handler)

MountDeleteHandler configures the mux to serve the "Backup Service" service "delete" endpoint.

func MountGetHandler

func MountGetHandler(mux goahttp.Muxer, h http.Handler)

MountGetHandler configures the mux to serve the "Backup Service" service "get" endpoint.

func MountUpdateHandler

func MountUpdateHandler(mux goahttp.Muxer, h http.Handler)

MountUpdateHandler configures the mux to serve the "Backup Service" service "update" endpoint.

func NewCreateBackup

func NewCreateBackup(body *CreateRequestBody) *backupservice.Backup

NewCreateBackup builds a Backup Service service create endpoint payload.

func NewCreateHandler

func NewCreateHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(err error) goahttp.Statuser,
) http.Handler

NewCreateHandler creates a HTTP handler which loads the HTTP request and calls the "Backup Service" service "create" endpoint.

func NewDeleteHandler

func NewDeleteHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(err error) goahttp.Statuser,
) http.Handler

NewDeleteHandler creates a HTTP handler which loads the HTTP request and calls the "Backup Service" service "delete" endpoint.

func NewDeletePayload

func NewDeletePayload(id string) *backupservice.DeletePayload

NewDeletePayload builds a Backup Service service delete endpoint payload.

func NewGetHandler

func NewGetHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(err error) goahttp.Statuser,
) http.Handler

NewGetHandler creates a HTTP handler which loads the HTTP request and calls the "Backup Service" service "get" endpoint.

func NewGetPayload

func NewGetPayload(id string) *backupservice.GetPayload

NewGetPayload builds a Backup Service service get endpoint payload.

func NewUpdateBackupresult

func NewUpdateBackupresult(body *UpdateRequestBody) *backupservice.Backupresult

NewUpdateBackupresult builds a Backup Service service update endpoint payload.

func NewUpdateHandler

func NewUpdateHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(err error) goahttp.Statuser,
) http.Handler

NewUpdateHandler creates a HTTP handler which loads the HTTP request and calls the "Backup Service" service "update" endpoint.

func UpdateBackupServicePath

func UpdateBackupServicePath() string

UpdateBackupServicePath returns the URL path to the Backup Service service update HTTP endpoint.

func ValidateUpdateRequestBody

func ValidateUpdateRequestBody(body *UpdateRequestBody) (err error)

ValidateUpdateRequestBody runs the validations defined on UpdateRequestBody

Types

type CreateRequestBody

type CreateRequestBody struct {
	// Name of pachyderm instance backed up
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// Namespace of resource backed up
	Namespace *string `form:"namespace,omitempty" json:"namespace,omitempty" xml:"namespace,omitempty"`
	// Name of target pod
	Pod *string `form:"pod,omitempty" json:"pod,omitempty" xml:"pod,omitempty"`
	// Name of container in pod
	Container *string `form:"container,omitempty" json:"container,omitempty" xml:"container,omitempty"`
	// base64 encoded command to run in pod
	Command *string `form:"command,omitempty" json:"command,omitempty" xml:"command,omitempty"`
	// Kubernetes secret containing S3 storage credentials
	StorageSecret *string `form:"storage_secret,omitempty" json:"storage_secret,omitempty" xml:"storage_secret,omitempty"`
	// base64 encoded json representation of object
	KubernetesResource *string `form:"kubernetes_resource,omitempty" json:"kubernetes_resource,omitempty" xml:"kubernetes_resource,omitempty"`
}

CreateRequestBody is the type of the "Backup Service" service "create" endpoint HTTP request body.

type CreateResponseBody

type CreateResponseBody struct {
	CreatedAt *string `form:"created_at,omitempty" json:"created_at,omitempty" xml:"created_at,omitempty"`
	UpdatedAt *string `form:"updated_at,omitempty" json:"updated_at,omitempty" xml:"updated_at,omitempty"`
	DeletedAt *string `form:"deleted_at,omitempty" json:"deleted_at,omitempty" xml:"deleted_at,omitempty"`
	ID        *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Current state of the job
	State *string `form:"state,omitempty" json:"state,omitempty" xml:"state,omitempty"`
	// Name of pachyderm instance backed up
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// Namespace of resource backed up
	Namespace *string `form:"namespace,omitempty" json:"namespace,omitempty" xml:"namespace,omitempty"`
	// Name of target pod
	Pod *string `form:"pod,omitempty" json:"pod,omitempty" xml:"pod,omitempty"`
	// Name of container in pod
	Container *string `form:"container,omitempty" json:"container,omitempty" xml:"container,omitempty"`
	// base64 encoded command to run in pod
	Command *string `form:"command,omitempty" json:"command,omitempty" xml:"command,omitempty"`
	// Kubernetes secret containing S3 storage credentials
	StorageSecret *string `form:"storage_secret,omitempty" json:"storage_secret,omitempty" xml:"storage_secret,omitempty"`
	// base64 encoded json representation of object
	KubernetesResource *string `form:"kubernetes_resource,omitempty" json:"kubernetes_resource,omitempty" xml:"kubernetes_resource,omitempty"`
	// URL of the uploaded backup tarball
	Location *string `form:"location,omitempty" json:"location,omitempty" xml:"location,omitempty"`
}

CreateResponseBody is the type of the "Backup Service" service "create" endpoint HTTP response body.

func NewCreateResponseBody

func NewCreateResponseBody(res *backupserviceviews.BackupresultView) *CreateResponseBody

NewCreateResponseBody builds the HTTP response body from the result of the "create" endpoint of the "Backup Service" service.

type DeleteBackupNotFoundResponseBody

type DeleteBackupNotFoundResponseBody struct {
	// backup resource not found
	Message string `form:"message" json:"message" xml:"message"`
}

DeleteBackupNotFoundResponseBody is the type of the "Backup Service" service "delete" endpoint HTTP response body for the "backup_not_found" error.

func NewDeleteBackupNotFoundResponseBody

func NewDeleteBackupNotFoundResponseBody(res *backupservice.BackupNotFound) *DeleteBackupNotFoundResponseBody

NewDeleteBackupNotFoundResponseBody builds the HTTP response body from the result of the "delete" endpoint of the "Backup Service" service.

type DeleteResponseBody

type DeleteResponseBody struct {
	CreatedAt *string `form:"created_at,omitempty" json:"created_at,omitempty" xml:"created_at,omitempty"`
	UpdatedAt *string `form:"updated_at,omitempty" json:"updated_at,omitempty" xml:"updated_at,omitempty"`
	DeletedAt *string `form:"deleted_at,omitempty" json:"deleted_at,omitempty" xml:"deleted_at,omitempty"`
	ID        *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Current state of the job
	State *string `form:"state,omitempty" json:"state,omitempty" xml:"state,omitempty"`
	// Name of pachyderm instance backed up
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// Namespace of resource backed up
	Namespace *string `form:"namespace,omitempty" json:"namespace,omitempty" xml:"namespace,omitempty"`
	// Name of target pod
	Pod *string `form:"pod,omitempty" json:"pod,omitempty" xml:"pod,omitempty"`
	// Name of container in pod
	Container *string `form:"container,omitempty" json:"container,omitempty" xml:"container,omitempty"`
	// base64 encoded command to run in pod
	Command *string `form:"command,omitempty" json:"command,omitempty" xml:"command,omitempty"`
	// Kubernetes secret containing S3 storage credentials
	StorageSecret *string `form:"storage_secret,omitempty" json:"storage_secret,omitempty" xml:"storage_secret,omitempty"`
	// base64 encoded json representation of object
	KubernetesResource *string `form:"kubernetes_resource,omitempty" json:"kubernetes_resource,omitempty" xml:"kubernetes_resource,omitempty"`
	// URL of the uploaded backup tarball
	Location *string `form:"location,omitempty" json:"location,omitempty" xml:"location,omitempty"`
}

DeleteResponseBody is the type of the "Backup Service" service "delete" endpoint HTTP response body.

func NewDeleteResponseBody

func NewDeleteResponseBody(res *backupserviceviews.BackupresultView) *DeleteResponseBody

NewDeleteResponseBody builds the HTTP response body from the result of the "delete" endpoint of the "Backup Service" service.

type ErrorNamer

type ErrorNamer interface {
	ErrorName() string
}

ErrorNamer is an interface implemented by generated error structs that exposes the name of the error as defined in the design.

type GetBackupNotFoundResponseBody

type GetBackupNotFoundResponseBody struct {
	// backup resource not found
	Message string `form:"message" json:"message" xml:"message"`
}

GetBackupNotFoundResponseBody is the type of the "Backup Service" service "get" endpoint HTTP response body for the "backup_not_found" error.

func NewGetBackupNotFoundResponseBody

func NewGetBackupNotFoundResponseBody(res *backupservice.BackupNotFound) *GetBackupNotFoundResponseBody

NewGetBackupNotFoundResponseBody builds the HTTP response body from the result of the "get" endpoint of the "Backup Service" service.

type GetResponseBody

type GetResponseBody struct {
	CreatedAt *string `form:"created_at,omitempty" json:"created_at,omitempty" xml:"created_at,omitempty"`
	UpdatedAt *string `form:"updated_at,omitempty" json:"updated_at,omitempty" xml:"updated_at,omitempty"`
	DeletedAt *string `form:"deleted_at,omitempty" json:"deleted_at,omitempty" xml:"deleted_at,omitempty"`
	ID        *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Current state of the job
	State *string `form:"state,omitempty" json:"state,omitempty" xml:"state,omitempty"`
	// Name of pachyderm instance backed up
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// Namespace of resource backed up
	Namespace *string `form:"namespace,omitempty" json:"namespace,omitempty" xml:"namespace,omitempty"`
	// Name of target pod
	Pod *string `form:"pod,omitempty" json:"pod,omitempty" xml:"pod,omitempty"`
	// Name of container in pod
	Container *string `form:"container,omitempty" json:"container,omitempty" xml:"container,omitempty"`
	// base64 encoded command to run in pod
	Command *string `form:"command,omitempty" json:"command,omitempty" xml:"command,omitempty"`
	// Kubernetes secret containing S3 storage credentials
	StorageSecret *string `form:"storage_secret,omitempty" json:"storage_secret,omitempty" xml:"storage_secret,omitempty"`
	// base64 encoded json representation of object
	KubernetesResource *string `form:"kubernetes_resource,omitempty" json:"kubernetes_resource,omitempty" xml:"kubernetes_resource,omitempty"`
	// URL of the uploaded backup tarball
	Location *string `form:"location,omitempty" json:"location,omitempty" xml:"location,omitempty"`
}

GetResponseBody is the type of the "Backup Service" service "get" endpoint HTTP response body.

func NewGetResponseBody

func NewGetResponseBody(res *backupserviceviews.BackupresultView) *GetResponseBody

NewGetResponseBody builds the HTTP response body from the result of the "get" endpoint of the "Backup Service" service.

type MountPoint

type MountPoint struct {
	// Method is the name of the service method served by the mounted HTTP handler.
	Method string
	// Verb is the HTTP method used to match requests to the mounted handler.
	Verb string
	// Pattern is the HTTP request path pattern used to match requests to the
	// mounted handler.
	Pattern string
}

MountPoint holds information about the mounted endpoints.

type Server

type Server struct {
	Mounts []*MountPoint
	Create http.Handler
	Get    http.Handler
	Update http.Handler
	Delete http.Handler
}

Server lists the Backup Service service endpoint HTTP handlers.

func New

func New(
	e *backupservice.Endpoints,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(err error) goahttp.Statuser,
) *Server

New instantiates HTTP handlers for all the Backup Service service endpoints using the provided encoder and decoder. The handlers are mounted on the given mux using the HTTP verb and path defined in the design. errhandler is called whenever a response fails to be encoded. formatter is used to format errors returned by the service methods prior to encoding. Both errhandler and formatter are optional and can be nil.

func (*Server) Mount

func (s *Server) Mount(mux goahttp.Muxer)

Mount configures the mux to serve the Backup Service endpoints.

func (*Server) Service

func (s *Server) Service() string

Service returns the name of the service served.

func (*Server) Use

func (s *Server) Use(m func(http.Handler) http.Handler)

Use wraps the server handlers with the given middleware.

type UpdateBackupNotFoundResponseBody

type UpdateBackupNotFoundResponseBody struct {
	// backup resource not found
	Message string `form:"message" json:"message" xml:"message"`
}

UpdateBackupNotFoundResponseBody is the type of the "Backup Service" service "update" endpoint HTTP response body for the "backup_not_found" error.

func NewUpdateBackupNotFoundResponseBody

func NewUpdateBackupNotFoundResponseBody(res *backupservice.BackupNotFound) *UpdateBackupNotFoundResponseBody

NewUpdateBackupNotFoundResponseBody builds the HTTP response body from the result of the "update" endpoint of the "Backup Service" service.

type UpdateRequestBody

type UpdateRequestBody struct {
	CreatedAt *string `form:"created_at,omitempty" json:"created_at,omitempty" xml:"created_at,omitempty"`
	UpdatedAt *string `form:"updated_at,omitempty" json:"updated_at,omitempty" xml:"updated_at,omitempty"`
	DeletedAt *string `form:"deleted_at,omitempty" json:"deleted_at,omitempty" xml:"deleted_at,omitempty"`
	ID        *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Current state of the job
	State *string `form:"state,omitempty" json:"state,omitempty" xml:"state,omitempty"`
	// Name of pachyderm instance backed up
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// Namespace of resource backed up
	Namespace *string `form:"namespace,omitempty" json:"namespace,omitempty" xml:"namespace,omitempty"`
	// Name of target pod
	Pod *string `form:"pod,omitempty" json:"pod,omitempty" xml:"pod,omitempty"`
	// Name of container in pod
	Container *string `form:"container,omitempty" json:"container,omitempty" xml:"container,omitempty"`
	// base64 encoded command to run in pod
	Command *string `form:"command,omitempty" json:"command,omitempty" xml:"command,omitempty"`
	// Kubernetes secret containing S3 storage credentials
	StorageSecret *string `form:"storage_secret,omitempty" json:"storage_secret,omitempty" xml:"storage_secret,omitempty"`
	// base64 encoded json representation of object
	KubernetesResource *string `form:"kubernetes_resource,omitempty" json:"kubernetes_resource,omitempty" xml:"kubernetes_resource,omitempty"`
	// URL of the uploaded backup tarball
	Location *string `form:"location,omitempty" json:"location,omitempty" xml:"location,omitempty"`
}

UpdateRequestBody is the type of the "Backup Service" service "update" endpoint HTTP request body.

type UpdateResponseBody

type UpdateResponseBody struct {
	CreatedAt *string `form:"created_at,omitempty" json:"created_at,omitempty" xml:"created_at,omitempty"`
	UpdatedAt *string `form:"updated_at,omitempty" json:"updated_at,omitempty" xml:"updated_at,omitempty"`
	DeletedAt *string `form:"deleted_at,omitempty" json:"deleted_at,omitempty" xml:"deleted_at,omitempty"`
	ID        *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Current state of the job
	State *string `form:"state,omitempty" json:"state,omitempty" xml:"state,omitempty"`
	// Name of pachyderm instance backed up
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// Namespace of resource backed up
	Namespace *string `form:"namespace,omitempty" json:"namespace,omitempty" xml:"namespace,omitempty"`
	// Name of target pod
	Pod *string `form:"pod,omitempty" json:"pod,omitempty" xml:"pod,omitempty"`
	// Name of container in pod
	Container *string `form:"container,omitempty" json:"container,omitempty" xml:"container,omitempty"`
	// base64 encoded command to run in pod
	Command *string `form:"command,omitempty" json:"command,omitempty" xml:"command,omitempty"`
	// Kubernetes secret containing S3 storage credentials
	StorageSecret *string `form:"storage_secret,omitempty" json:"storage_secret,omitempty" xml:"storage_secret,omitempty"`
	// base64 encoded json representation of object
	KubernetesResource *string `form:"kubernetes_resource,omitempty" json:"kubernetes_resource,omitempty" xml:"kubernetes_resource,omitempty"`
	// URL of the uploaded backup tarball
	Location *string `form:"location,omitempty" json:"location,omitempty" xml:"location,omitempty"`
}

UpdateResponseBody is the type of the "Backup Service" service "update" endpoint HTTP response body.

func NewUpdateResponseBody

func NewUpdateResponseBody(res *backupserviceviews.BackupresultView) *UpdateResponseBody

NewUpdateResponseBody builds the HTTP response body from the result of the "update" endpoint of the "Backup Service" service.

Jump to

Keyboard shortcuts

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