service

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StatusPath status path.
	StatusPath = "/status"
	// StatusPath root path.
	RootPath = "/"
)

Variables

View Source
var ErrNonSuccessfulStatusCode = errors.New("non-successful status-code")

ErrNonSuccessfulStatusCode any other status-code than 200.

Functions

func StatusRequest

func StatusRequest(logger *slog.Logger, c *fasthttp.HostClient) ([]byte, error)

StatusRequest executes a GET request on the edit-server status path, using the informed client address ("Addr" attribute) to create the request URI. Returns the response body and error when applicable.

Types

type Service

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

Service represents the backend edit-server API, it handles the requests against the supported endpoints effectively exposing the application features.

func NewService

func NewService(logger *slog.Logger, ed editor.Interface) *Service

NewService returns a new service using a shared logger and editor instances.

func (*Service) RequestHandler

func (s *Service) RequestHandler() fasthttp.RequestHandler

RequestHandler instantiates the request router for the application endpoints.

Jump to

Keyboard shortcuts

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