server

package
v0.0.0-...-69b4764 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeDownloadFileRequest

func DecodeDownloadFileRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (any, error)

DecodeDownloadFileRequest returns a decoder for requests sent to the oci download-file endpoint.

func DecodeDownloadFileSha256Request

func DecodeDownloadFileSha256Request(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (any, error)

DecodeDownloadFileSha256Request returns a decoder for requests sent to the oci download-file-sha256 endpoint.

func DecodeListFilesRequest

func DecodeListFilesRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (any, error)

DecodeListFilesRequest returns a decoder for requests sent to the oci list-files endpoint.

func DownloadFileOciPath

func DownloadFileOciPath(repository string) string

DownloadFileOciPath returns the URL path to the oci service download-file HTTP endpoint.

func DownloadFileSha256OciPath

func DownloadFileSha256OciPath(repository string) string

DownloadFileSha256OciPath returns the URL path to the oci service download-file-sha256 HTTP endpoint.

func EncodeDownloadFileResponse

func EncodeDownloadFileResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error

EncodeDownloadFileResponse returns an encoder for responses returned by the oci download-file endpoint.

func EncodeDownloadFileSha256Response

func EncodeDownloadFileSha256Response(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error

EncodeDownloadFileSha256Response returns an encoder for responses returned by the oci download-file-sha256 endpoint.

func EncodeListFilesResponse

func EncodeListFilesResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error

EncodeListFilesResponse returns an encoder for responses returned by the oci list-files endpoint.

func ListFilesOciPath

func ListFilesOciPath(repository string) string

ListFilesOciPath returns the URL path to the oci service list-files HTTP endpoint.

func Mount

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

Mount configures the mux to serve the oci endpoints.

func MountDownloadFileHandler

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

MountDownloadFileHandler configures the mux to serve the "oci" service "download-file" endpoint.

func MountDownloadFileSha256Handler

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

MountDownloadFileSha256Handler configures the mux to serve the "oci" service "download-file-sha256" endpoint.

func MountListFilesHandler

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

MountListFilesHandler configures the mux to serve the "oci" service "list-files" endpoint.

func NewDownloadFileHandler

func NewDownloadFileHandler(
	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(ctx context.Context, err error) goahttp.Statuser,
) http.Handler

NewDownloadFileHandler creates a HTTP handler which loads the HTTP request and calls the "oci" service "download-file" endpoint.

func NewDownloadFilePayload

func NewDownloadFilePayload(repository string, tag string, file *string, fileRegex *string) *oci.DownloadFilePayload

NewDownloadFilePayload builds a oci service download-file endpoint payload.

func NewDownloadFileSha256Handler

func NewDownloadFileSha256Handler(
	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(ctx context.Context, err error) goahttp.Statuser,
) http.Handler

NewDownloadFileSha256Handler creates a HTTP handler which loads the HTTP request and calls the "oci" service "download-file-sha256" endpoint.

func NewDownloadFileSha256Payload

func NewDownloadFileSha256Payload(repository string, file string, tag string) *oci.DownloadFileSha256Payload

NewDownloadFileSha256Payload builds a oci service download-file-sha256 endpoint payload.

func NewListFilesHandler

func NewListFilesHandler(
	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(ctx context.Context, err error) goahttp.Statuser,
) http.Handler

NewListFilesHandler creates a HTTP handler which loads the HTTP request and calls the "oci" service "list-files" endpoint.

func NewListFilesPayload

func NewListFilesPayload(repository string, tag string) *oci.ListFilesPayload

NewListFilesPayload builds a oci service list-files endpoint payload.

Types

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
	ListFiles          http.Handler
	DownloadFile       http.Handler
	DownloadFileSha256 http.Handler
}

Server lists the oci service endpoint HTTP handlers.

func New

func New(
	e *oci.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(ctx context.Context, err error) goahttp.Statuser,
) *Server

New instantiates HTTP handlers for all the oci 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) MethodNames

func (s *Server) MethodNames() []string

MethodNames returns the methods served.

func (*Server) Mount

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

Mount configures the mux to serve the oci 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.

Jump to

Keyboard shortcuts

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