Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (_c Client) BusPNG(ctx context.Context, relativeURL string) (res *http.Response, err error)
- func (_c Client) Calculator(ctx context.Context, method string, relativeURL string, body any) (res *http.Response, err error)
- func (_c Client) Echo(ctx context.Context, method string, relativeURL string, body any) (res *http.Response, err error)
- func (_c Client) ForHost(host string) Client
- func (_c Client) Hello(ctx context.Context, method string, relativeURL string, body any) (res *http.Response, err error)
- func (_c Client) Localization(ctx context.Context, method string, relativeURL string, body any) (res *http.Response, err error)
- func (_c Client) Ping(ctx context.Context, method string, relativeURL string, body any) (res *http.Response, err error)
- func (_c Client) Root(ctx context.Context, method string, relativeURL string, body any) (res *http.Response, err error)
- func (_c Client) WithOptions(opts ...pub.Option) Client
- type MulticastClient
- func (_c MulticastClient) BusPNG(ctx context.Context, relativeURL string) iter.Seq[*pub.Response]
- func (_c MulticastClient) Calculator(ctx context.Context, method string, relativeURL string, body any) iter.Seq[*pub.Response]
- func (_c MulticastClient) Echo(ctx context.Context, method string, relativeURL string, body any) iter.Seq[*pub.Response]
- func (_c MulticastClient) ForHost(host string) MulticastClient
- func (_c MulticastClient) Hello(ctx context.Context, method string, relativeURL string, body any) iter.Seq[*pub.Response]
- func (_c MulticastClient) Localization(ctx context.Context, method string, relativeURL string, body any) iter.Seq[*pub.Response]
- func (_c MulticastClient) Ping(ctx context.Context, method string, relativeURL string, body any) iter.Seq[*pub.Response]
- func (_c MulticastClient) Root(ctx context.Context, method string, relativeURL string, body any) iter.Seq[*pub.Response]
- func (_c MulticastClient) WithOptions(opts ...pub.Option) MulticastClient
Constants ¶
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.
const Hostname = "hello.example"
Hostname is the default hostname of the microservice.
const Name = "Hello"
Name is the decorative PascalCase name of the microservice.
const Version = 326
Version is a generation counter bumped on each regeneration, not a semantic version.
Variables ¶
var BusPNG = define.Web{ Host: Hostname, Method: "GET", Route: "/bus.png", }
BusPNG serves an image from the embedded resources.
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.
var Echo = define.Web{ Host: Hostname, Method: "ANY", Route: "/echo", }
Echo back the incoming request in wire format.
var Greeting = define.Config{ Value: string(""), Default: "Hello", }
Greeting to use.
var Hello = define.Web{ Host: Hostname, Method: "ANY", Route: "/hello", }
Hello prints a greeting.
var Localization = define.Web{ Host: Hostname, Method: "ANY", Route: "/localization", }
Localization prints hello in the language best matching the request's Accept-Language header.
var Ping = define.Web{ Host: Hostname, Method: "ANY", Route: "/ping", }
Ping all microservices and list them.
var Repeat = define.Config{ Value: int(0), Default: "1", Validation: "int [0,100]", }
Repeat indicates how many times to display the greeting.
var Root = define.Web{ Host: Hostname, Method: "ANY", Route: "//root", }
Root is the top-most root page.
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 (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 ¶
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.
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) 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.