helloapi

package
v1.41.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Description = `The Hello microservice demonstrates the various capabilities of a microservice.`

Description is the human-readable summary of the microservice, surfaced in OpenAPI and discovery.

View Source
const Hostname = "hello.example"

Hostname is the default hostname of the microservice.

View Source
const Name = "Hello"

Name is the decorative PascalCase name of the microservice.

View Source
const Version = 326

Version is a generation counter bumped on each regeneration, not a semantic version.

Variables

View Source
var BusPNG = define.Web{
	Host: Hostname, Method: "GET", Route: "/bus.png",
}

BusPNG serves an image from the embedded resources.

View Source
var Calculator = define.Web{
	Host: Hostname, Method: "ANY", Route: "/calculator",
}

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.

View Source
var Echo = define.Web{
	Host: Hostname, Method: "ANY", Route: "/echo",
}

Echo back the incoming request in wire format.

View Source
var Greeting = define.Config{
	Value:   string(""),
	Default: "Hello",
}

Greeting to use.

View Source
var Hello = define.Web{
	Host: Hostname, Method: "ANY", Route: "/hello",
}

Hello prints a greeting.

View Source
var Localization = define.Web{
	Host: Hostname, Method: "ANY", Route: "/localization",
}

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

View Source
var Ping = define.Web{
	Host: Hostname, Method: "ANY", Route: "/ping",
}

Ping all microservices and list them.

View Source
var Repeat = define.Config{
	Value:      int(0),
	Default:    "1",
	Validation: "int [0,100]",
}

Repeat indicates how many times to display the greeting.

View Source
var Root = define.Web{
	Host: Hostname, Method: "ANY", Route: "//root",
}

Root is the top-most root page.

View Source
var TickTock = define.Ticker{
	Interval: 10 * time.Second,
}

TickTock is executed every 10 seconds.

Functions

This section is empty.

Types

type Client

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

Client is a lightweight proxy for making unicast calls to the microservice.

func NewClient

func NewClient(caller service.Publisher) Client

NewClient creates a new unicast client proxy to the microservice.

func (Client) BusPNG

func (_c Client) BusPNG(ctx context.Context, relativeURL string) (res *http.Response, err error)

BusPNG serves an image from the embedded resources.

func (Client) Calculator

func (_c Client) Calculator(ctx context.Context, method string, relativeURL string, body any) (res *http.Response, err 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 (Client) Echo

func (_c Client) Echo(ctx context.Context, method string, relativeURL string, body any) (res *http.Response, err error)

Echo back the incoming request in wire format.

func (Client) ForHost

func (_c Client) ForHost(host string) Client

ForHost returns a copy of the client with a different hostname to be applied to requests.

func (Client) Hello

func (_c Client) Hello(ctx context.Context, method string, relativeURL string, body any) (res *http.Response, err error)

Hello prints a greeting.

func (Client) Localization

func (_c Client) Localization(ctx context.Context, method string, relativeURL string, body any) (res *http.Response, err error)

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

func (Client) Ping

func (_c Client) Ping(ctx context.Context, method string, relativeURL string, body any) (res *http.Response, err error)

Ping all microservices and list them.

func (Client) Root

func (_c Client) Root(ctx context.Context, method string, relativeURL string, body any) (res *http.Response, err error)

Root is the top-most root page.

func (Client) WithOptions added in v1.13.1

func (_c Client) WithOptions(opts ...pub.Option) Client

WithOptions returns a copy of the client with options to be applied to requests.

type MulticastClient

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

MulticastClient is a lightweight proxy for making multicast calls to the microservice.

func NewMulticastClient

func NewMulticastClient(caller service.Publisher) MulticastClient

NewMulticastClient creates a new multicast client proxy to the microservice.

func (MulticastClient) BusPNG

func (_c MulticastClient) BusPNG(ctx context.Context, relativeURL string) iter.Seq[*pub.Response]

BusPNG serves an image from the embedded resources.

func (MulticastClient) Calculator

func (_c MulticastClient) Calculator(ctx context.Context, method string, relativeURL string, body any) iter.Seq[*pub.Response]

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 (MulticastClient) Echo

func (_c MulticastClient) Echo(ctx context.Context, method string, relativeURL string, body any) iter.Seq[*pub.Response]

Echo back the incoming request in wire format.

func (MulticastClient) ForHost

func (_c MulticastClient) ForHost(host string) MulticastClient

ForHost returns a copy of the client with a different hostname to be applied to requests.

func (MulticastClient) Hello

func (_c MulticastClient) Hello(ctx context.Context, method string, relativeURL string, body any) iter.Seq[*pub.Response]

Hello prints a greeting.

func (MulticastClient) Localization

func (_c MulticastClient) Localization(ctx context.Context, method string, relativeURL string, body any) iter.Seq[*pub.Response]

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

func (MulticastClient) Ping

func (_c MulticastClient) Ping(ctx context.Context, method string, relativeURL string, body any) iter.Seq[*pub.Response]

Ping all microservices and list them.

func (MulticastClient) Root

func (_c MulticastClient) Root(ctx context.Context, method string, relativeURL string, body any) iter.Seq[*pub.Response]

Root is the top-most root page.

func (MulticastClient) WithOptions added in v1.13.1

func (_c MulticastClient) WithOptions(opts ...pub.Option) MulticastClient

WithOptions returns a copy of the client with options to be applied to requests.

Jump to

Keyboard shortcuts

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