test

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "test"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [3]string{"http_method", "grpc_method", "grpc_stream"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func NewGrpcMethodEndpoint

func NewGrpcMethodEndpoint(s Service) goa.Endpoint

NewGrpcMethodEndpoint returns an endpoint function that calls the method "grpc_method" of service "test".

func NewGrpcStreamEndpoint

func NewGrpcStreamEndpoint(s Service) goa.Endpoint

NewGrpcStreamEndpoint returns an endpoint function that calls the method "grpc_stream" of service "test".

func NewHTTPMethodEndpoint

func NewHTTPMethodEndpoint(s Service) goa.Endpoint

NewHTTPMethodEndpoint returns an endpoint function that calls the method "http_method" of service "test".

Types

type Client

type Client struct {
	HTTPMethodEndpoint goa.Endpoint
	GrpcMethodEndpoint goa.Endpoint
	GrpcStreamEndpoint goa.Endpoint
}

Client is the "test" service client.

func NewClient

func NewClient(hTTPMethod, grpcMethod, grpcStream goa.Endpoint) *Client

NewClient initializes a "test" service client given the endpoints.

func (*Client) GrpcMethod

func (c *Client) GrpcMethod(ctx context.Context, p *Fields) (res *Fields, err error)

GrpcMethod calls the "grpc_method" endpoint of the "test" service.

func (*Client) GrpcStream

func (c *Client) GrpcStream(ctx context.Context) (res GrpcStreamClientStream, err error)

GrpcStream calls the "grpc_stream" endpoint of the "test" service.

func (*Client) HTTPMethod

func (c *Client) HTTPMethod(ctx context.Context, p *Fields) (res *Fields, err error)

HTTPMethod calls the "http_method" endpoint of the "test" service.

type Endpoints

type Endpoints struct {
	HTTPMethod goa.Endpoint
	GrpcMethod goa.Endpoint
	GrpcStream goa.Endpoint
}

Endpoints wraps the "test" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "test" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "test" service endpoints.

type Fields

type Fields struct {
	// String operand
	S *string
	// Int operand
	I *int
}

Fields is the payload type of the test service http_method method.

type GrpcStreamClientStream

type GrpcStreamClientStream interface {
	// Send streams instances of "Fields".
	Send(*Fields) error
	// Recv reads instances of "Fields" from the stream.
	Recv() (*Fields, error)
	// Close closes the stream.
	Close() error
}

GrpcStreamClientStream is the interface a "grpc_stream" endpoint client stream must satisfy.

type GrpcStreamEndpointInput

type GrpcStreamEndpointInput struct {
	// Stream is the server stream used by the "grpc_stream" method to send data.
	Stream GrpcStreamServerStream
}

GrpcStreamEndpointInput holds both the payload and the server stream of the "grpc_stream" method.

type GrpcStreamServerStream

type GrpcStreamServerStream interface {
	// Send streams instances of "Fields".
	Send(*Fields) error
	// Recv reads instances of "Fields" from the stream.
	Recv() (*Fields, error)
	// Close closes the stream.
	Close() error
}

GrpcStreamServerStream is the interface a "grpc_stream" endpoint server stream must satisfy.

type Service

type Service interface {
	// HTTPMethod implements http_method.
	HTTPMethod(context.Context, *Fields) (res *Fields, err error)
	// GrpcMethod implements grpc_method.
	GrpcMethod(context.Context, *Fields) (res *Fields, err error)
	// GrpcStream implements grpc_stream.
	GrpcStream(context.Context, GrpcStreamServerStream) (err error)
}

Service is the test service interface.

Jump to

Keyboard shortcuts

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