testext

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Code generated by Boson - DO NOT EDIT.

Timestamp: Thu, 22 Jun 2023 09:32:59 EDT
Source:    other_service.go
Generator: https://github.com/monadicstack/abide

Code generated by Boson - DO NOT EDIT.

Timestamp: Thu, 22 Jun 2023 09:32:59 EDT
Source:    other_service.go
Generator: https://github.com/monadicstack/abide

Code generated by Boson - DO NOT EDIT.

Timestamp: Thu, 22 Jun 2023 09:32:59 EDT
Source:    sample_service.go
Generator: https://github.com/monadicstack/abide

Code generated by Boson - DO NOT EDIT.

Timestamp: Thu, 22 Jun 2023 09:32:59 EDT
Source:    sample_service.go
Generator: https://github.com/monadicstack/abide

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OtherServiceClient

func OtherServiceClient(address string, options ...clients.ClientOption) testext.OtherService

OtherServiceClient creates an RPC client that conforms to the OtherService interface, but delegates work to remote instances. You must supply the base address of the remote service gateway instance or the load balancer for that service.

OtherService primarily exists to show that we can send event signals between services.

func OtherServiceServer

func OtherServiceServer(handler testext.OtherService, middleware ...services.MiddlewareFunc) *services.Service

OtherServiceServer accepts your "real" OtherService instance (the thing that really does the work), and returns a set of endpoint routes which allow this service to be consumed via the gateways/listeners you configure in main().

// Example
serviceHandler := testext.OtherServiceHandler{ /* set up to your liking */ }
server := services.New(
	services.Listen(apis.NewGateway()),
	services.Register(testextgen.OtherServiceServer(serviceHandler)),
)
server.Listen()

From there, you can add middleware, event sourcing support and more. Look at the abide documentation for more details/examples on how to make your service production ready.

func SampleServiceClient

func SampleServiceClient(address string, options ...clients.ClientOption) testext.SampleService

SampleServiceClient creates an RPC client that conforms to the SampleService interface, but delegates work to remote instances. You must supply the base address of the remote service gateway instance or the load balancer for that service.

SampleService is a mix of different options, parameter setups, and responses so that we can run integration tests using our code-generated clients. Each method is nothing special, but they each do something a little differently than the rest to flex different parts of the framework.

func SampleServiceServer

func SampleServiceServer(handler testext.SampleService, middleware ...services.MiddlewareFunc) *services.Service

SampleServiceServer accepts your "real" SampleService instance (the thing that really does the work), and returns a set of endpoint routes which allow this service to be consumed via the gateways/listeners you configure in main().

// Example
serviceHandler := testext.SampleServiceHandler{ /* set up to your liking */ }
server := services.New(
	services.Listen(apis.NewGateway()),
	services.Register(testextgen.SampleServiceServer(serviceHandler)),
)
server.Listen()

From there, you can add middleware, event sourcing support and more. Look at the abide documentation for more details/examples on how to make your service production ready.

Types

This section is empty.

Jump to

Keyboard shortcuts

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