helloworld

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package helloworld implements the helloworld.example microservice.

The HelloWorld microservice demonstrates the minimalist classic example.

Index

Constants

View Source
const Hostname = "helloworld.example"

Hostname is the default hostname of the microservice: helloworld.example.

View Source
const SourceCodeSHA256 = "b8caa2f68ddc2f5c71507099f34710804757449cf9250eb4f2889027bc12516a"
View Source
const Timestamp = "2024-08-01T15:49:27.978935Z"
View Source
const Version = 13

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

type Mock = intermediate.Mock

Mock is a mockable version of the helloworld.example microservice, allowing functions, event sinks and web handlers to be mocked.

func NewMock

func NewMock() *Mock

New creates a new mockable version of the microservice.

type Service

type Service struct {
	*intermediate.Intermediate // DO NOT REMOVE
}

Service implements the helloworld.example microservice.

The HelloWorld microservice demonstrates the minimalist classic example.

func NewService

func NewService() *Service

NewService creates a new helloworld.example microservice.

func (*Service) HelloWorld

func (svc *Service) HelloWorld(w http.ResponseWriter, r *http.Request) (err error)

HelloWorld prints the classic greeting.

func (*Service) Init

func (svc *Service) Init(initializer func(svc *Service)) *Service

Init enables a single-statement pattern for initializing the microservice.

svc.Init(func(svc Service) {
	svc.SetGreeting("Hello")
})

func (*Service) OnShutdown

func (svc *Service) OnShutdown(ctx context.Context) (err error)

OnShutdown is called when the microservice is shut down.

func (*Service) OnStartup

func (svc *Service) OnStartup(ctx context.Context) (err error)

OnStartup is called when the microservice is started up.

Directories

Path Synopsis
app
Package helloworldapi implements the public API of the helloworld.example microservice, including clients and data structures.
Package helloworldapi implements the public API of the helloworld.example microservice, including clients and data structures.
Package intermediate serves as the foundation of the helloworld.example microservice.
Package intermediate serves as the foundation of the helloworld.example microservice.

Jump to

Keyboard shortcuts

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