blueprint

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 4 Imported by: 0

README

Blueprint

This package demonstrates the recommended pattern for internal packages with a URI endpoint. There will be times when not all layers will be required. When this happens, remove the files not needed to keep the package as clean as possible

Documentation

Index

Constants

View Source
const (
	// ApiBlueprintPrefix base URI prefix for all blueprint routes
	ApiBlueprintPrefix = common.ApiV1UriPrefix + "/blueprint"
)
View Source
const BlueprintURIVariableId = "blueprintId"
View Source
const (

	// ErrKeyBlueprintError error key placeholder
	ErrKeyBlueprintError string = "BlueprintError"
)

Variables

View Source
var (
	// ApiBlueprintIdVariable URI variable used to get blueprint Id out of URI
	ApiBlueprintIdVariable = fmt.Sprintf("/{%s}", BlueprintURIVariableId)
)

Functions

func AttachRoutes

func AttachRoutes(request *AttachRoutesRequest)

AttachRoutes attaches blueprint handler to corresponding routes on router

Types

type AttachRoutesRequest

type AttachRoutesRequest struct {
	// Router main router being served by Api
	Router *router.Router

	// Handler valid blueprint handler
	Handler blueprintHandler
}

AttachRoutesRequest holds everything needed to attach blueprint routes to router

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler manages blueprint requests

func NewHandler

func NewHandler(service blueprintService, validator blueprintValidator) *Handler

NewHandler returns blueprint handler

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service holds and manages blueprint business logic

func NewService

func NewService(blueprintRespository blueprintRespository) *Service

NewService created blueprint service

Jump to

Keyboard shortcuts

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