frontend

package
v0.0.0-...-d3eef10 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFrontendUpload       = errors.New("Frontend: image upload failed")
	ErrFrontendDistribution = errors.New("Frontend: distribution set failed")
	ErrFrontendDeployment   = errors.New("Frontend: deployment set failed")
	ErrFrontendBadRequest   = errors.New("Frontend: bad request")
)
View Source
var (
	// ErrBadRouting is returned when an expected path variable is missing.
	// It always indicates programmer error.
	ErrBadRouting = errors.New("inconsistent mapping between route and handler (programmer error)")
)

Functions

func MakeFrontendHTTPHandler

func MakeFrontendHTTPHandler(s FrontendService, logger log.Logger) http.Handler

func MakeGetDeployment

func MakeGetDeployment(s FrontendService) endpoint.Endpoint

func MakeGetDistribution

func MakeGetDistribution(s FrontendService) endpoint.Endpoint

func MakeGetUpload

func MakeGetUpload(s FrontendService) endpoint.Endpoint

func MakePostDeployment

func MakePostDeployment(s FrontendService) endpoint.Endpoint

func MakePostDistribution

func MakePostDistribution(s FrontendService) endpoint.Endpoint

func MakePostUpload

func MakePostUpload(s FrontendService) endpoint.Endpoint

Types

type Endpoints

type Endpoints struct {
	PostUpload       endpoint.Endpoint
	GetUpload        endpoint.Endpoint
	PostDistribution endpoint.Endpoint
	GetDistribution  endpoint.Endpoint
	PostDeployment   endpoint.Endpoint
	GetDeployment    endpoint.Endpoint
}

func MakeFrontendServerEndpoints

func MakeFrontendServerEndpoints(s FrontendService) Endpoints

type FrontendService

type FrontendService interface {
	PostUpload(ctx context.Context, n string, v string, f string) error
	GetUpload(ctx context.Context, n string) (deployment.Upload, error)
	// DeleteUpload(ctx context.Context, n string) error
	PostDistribution(ctx context.Context, n string, v string, u string) error
	GetDistribution(ctx context.Context, n string) (deployment.Distribution, error)
	// DeleteDistribution(ctx context.Context, n string) error
	PostDeployment(ctx context.Context, t string, d string) error
	GetDeployment(ctx context.Context, t string) (deployment.Deployment, error)
}

func NewHawkbitFrontendService

func NewHawkbitFrontendService() FrontendService

type Middleware

type Middleware func(FrontendService) FrontendService

Middleware describes a service (as opposed to endpoint) middleware.

func LoggingFrontendMiddleware

func LoggingFrontendMiddleware(logger log.Logger) Middleware

Jump to

Keyboard shortcuts

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