hello

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: 14 Imported by: 0

Documentation

Overview

Package hello implements the hello.example microservice.

The Hello microservice demonstrates the various capabilities of a microservice.

Index

Constants

View Source
const Hostname = "hello.example"

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

View Source
const SourceCodeSHA256 = "f9e6ef1c9a1d9a2d49498daeb377e5c06caad04dfecb909f4c3e28d84fdaeeca"
View Source
const Timestamp = "2024-08-01T15:49:27.6478Z"
View Source
const Version = 259

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

type Mock = intermediate.Mock

Mock is a mockable version of the hello.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 hello.example microservice.

The Hello microservice demonstrates the various capabilities of a microservice.

func NewService

func NewService() *Service

NewService creates a new hello.example microservice.

func (*Service) BusPNG

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

BusPNG serves an image from the embedded resources.

func (*Service) Calculator

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

Calculator renders a UI for a calculator. The calculation operation is delegated to another microservice in order to demonstrate a call from one microservice to another.

func (*Service) Echo

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

Echo back the incoming request in wire format.

func (*Service) Hello

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

Hello prints a 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) Localization

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

Localization prints hello in the language best matching the request's Accept-Language header.

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.

func (*Service) Ping

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

Ping all microservices and list them.

func (*Service) Root

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

Root is the top-most root page.

func (*Service) TickTock

func (svc *Service) TickTock(ctx context.Context) error

TickTock is executed every 10 seconds.

Directories

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

Jump to

Keyboard shortcuts

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