lorem

package
v0.0.0-...-d0adc60 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBadRouting is returned when an expected path variable is missing.
	ErrBadRouting = errors.New("inconsistent mapping between route and handler (programmer error)")
)
View Source
var (
	ErrRequestTypeNotFound = errors.New("Request type only valid for word, sentence and paragraph")
)

Functions

func MakeHttpHandler

func MakeHttpHandler(ctx context.Context, endpoint Endpoints, logger log.Logger) http.Handler

func MakeLoremEndpoint

func MakeLoremEndpoint(svc Service) endpoint.Endpoint

Types

type Endpoints

type Endpoints struct {
	LoremEndpoint endpoint.Endpoint
}

type LoremRequest

type LoremRequest struct {
	RequestType string
	Min         int
	Max         int
}

type LoremResponse

type LoremResponse struct {
	Message string `json:"message"`
	Err     error  `json:"err,omitempty"`
}

type LoremService

type LoremService struct {
}

func (LoremService) Paragraph

func (LoremService) Paragraph(min, max int) string

func (LoremService) Sentence

func (LoremService) Sentence(min, max int) string

func (LoremService) Word

func (LoremService) Word(min, max int) string

type Service

type Service interface {
	Word(min, max int) string
	Sentence(min, max int) string
	Paragraph(min, max int) string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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