server

package
v0.0.0-...-1a1a679 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2019 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AvailableToolsPath

func AvailableToolsPath() string

AvailableToolsPath returns the URL path to the tools service available HTTP endpoint.

func DecodeInstallRequest

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

DecodeInstallRequest returns a decoder for requests sent to the tools install endpoint.

func DecodeRemoveRequest

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

DecodeRemoveRequest returns a decoder for requests sent to the tools remove endpoint.

func EncodeAvailableResponse

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

EncodeAvailableResponse returns an encoder for responses returned by the tools available endpoint.

func EncodeInstallResponse

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

EncodeInstallResponse returns an encoder for responses returned by the tools install endpoint.

func EncodeInstalledResponse

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

EncodeInstalledResponse returns an encoder for responses returned by the tools installed endpoint.

func EncodeRemoveResponse

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

EncodeRemoveResponse returns an encoder for responses returned by the tools remove endpoint.

func InstallToolsPath

func InstallToolsPath() string

InstallToolsPath returns the URL path to the tools service install HTTP endpoint.

func InstalledToolsPath

func InstalledToolsPath() string

InstalledToolsPath returns the URL path to the tools service installed HTTP endpoint.

func Mount

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

Mount configures the mux to serve the tools endpoints.

func MountAvailableHandler

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

MountAvailableHandler configures the mux to serve the "tools" service "available" endpoint.

func MountInstallHandler

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

MountInstallHandler configures the mux to serve the "tools" service "install" endpoint.

func MountInstalledHandler

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

MountInstalledHandler configures the mux to serve the "tools" service "installed" endpoint.

func MountRemoveHandler

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

MountRemoveHandler configures the mux to serve the "tools" service "remove" endpoint.

func NewAvailableHandler

func NewAvailableHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewAvailableHandler creates a HTTP handler which loads the HTTP request and calls the "tools" service "available" endpoint.

func NewInstallHandler

func NewInstallHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewInstallHandler creates a HTTP handler which loads the HTTP request and calls the "tools" service "install" endpoint.

func NewInstallToolPayload

func NewInstallToolPayload(body *InstallRequestBody) *tools.ToolPayload

NewInstallToolPayload builds a tools service install endpoint payload.

func NewInstalledHandler

func NewInstalledHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewInstalledHandler creates a HTTP handler which loads the HTTP request and calls the "tools" service "installed" endpoint.

func NewRemoveHandler

func NewRemoveHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewRemoveHandler creates a HTTP handler which loads the HTTP request and calls the "tools" service "remove" endpoint.

func NewRemoveToolPayload

func NewRemoveToolPayload(body *RemoveRequestBody, packager string, name string, version string) *tools.ToolPayload

NewRemoveToolPayload builds a tools service remove endpoint payload.

func RemoveToolsPath

func RemoveToolsPath(packager string, name string, version string) string

RemoveToolsPath returns the URL path to the tools service remove HTTP endpoint.

func ValidateInstallRequestBody

func ValidateInstallRequestBody(body *InstallRequestBody) (err error)

ValidateInstallRequestBody runs the validations defined on InstallRequestBody

Types

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 InstallRequestBody

type InstallRequestBody struct {
	// The name of the tool
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// The version of the tool
	Version *string `form:"version,omitempty" json:"version,omitempty" xml:"version,omitempty"`
	// The packager of the tool
	Packager *string `form:"packager,omitempty" json:"packager,omitempty" xml:"packager,omitempty"`
	// The url where the package can be found. Optional.
	// If present checksum must also be present.
	URL *string `form:"url,omitempty" json:"url,omitempty" xml:"url,omitempty"`
	// A checksum of the archive. Mandatory when url is present.
	// This ensures that the package is downloaded correcly.
	Checksum *string `form:"checksum,omitempty" json:"checksum,omitempty" xml:"checksum,omitempty"`
}

InstallRequestBody is the type of the "tools" service "install" endpoint HTTP request body.

type InstallResponseBody

type InstallResponseBody struct {
	// The status of the operation
	Status string `form:"status" json:"status" xml:"status"`
}

InstallResponseBody is the type of the "tools" service "install" endpoint HTTP response body.

func NewInstallResponseBody

func NewInstallResponseBody(res *toolsviews.OperationView) *InstallResponseBody

NewInstallResponseBody builds the HTTP response body from the result of the "install" endpoint of the "tools" 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 RemoveRequestBody

type RemoveRequestBody struct {
	// The url where the package can be found. Optional.
	// If present checksum must also be present.
	URL *string `form:"url,omitempty" json:"url,omitempty" xml:"url,omitempty"`
	// A checksum of the archive. Mandatory when url is present.
	// This ensures that the package is downloaded correcly.
	Checksum *string `form:"checksum,omitempty" json:"checksum,omitempty" xml:"checksum,omitempty"`
}

RemoveRequestBody is the type of the "tools" service "remove" endpoint HTTP request body.

type RemoveResponseBody

type RemoveResponseBody struct {
	// The status of the operation
	Status string `form:"status" json:"status" xml:"status"`
}

RemoveResponseBody is the type of the "tools" service "remove" endpoint HTTP response body.

func NewRemoveResponseBody

func NewRemoveResponseBody(res *toolsviews.OperationView) *RemoveResponseBody

NewRemoveResponseBody builds the HTTP response body from the result of the "remove" endpoint of the "tools" service.

type Server

type Server struct {
	Mounts    []*MountPoint
	Available http.Handler
	Installed http.Handler
	Install   http.Handler
	Remove    http.Handler
}

Server lists the tools service endpoint HTTP handlers.

func New

New instantiates HTTP handlers for all the tools 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 ToolResponse

type ToolResponse struct {
	// The name of the tool
	Name string `form:"name" json:"name" xml:"name"`
	// The version of the tool
	Version string `form:"version" json:"version" xml:"version"`
	// The packager of the tool
	Packager string `form:"packager" json:"packager" xml:"packager"`
}

ToolResponse is used to define fields on response body types.

type ToolResponseCollection

type ToolResponseCollection []*ToolResponse

ToolResponseCollection is the type of the "tools" service "available" endpoint HTTP response body.

func NewToolResponseCollection

func NewToolResponseCollection(res toolsviews.ToolCollectionView) ToolResponseCollection

NewToolResponseCollection builds the HTTP response body from the result of the "available" endpoint of the "tools" service.

Jump to

Keyboard shortcuts

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