Version: v0.17.0 Latest Latest

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

Go to latest
Published: Apr 5, 2022 License: MIT Imports: 1 Imported by: 1



Package service provides service definition.



This section is empty.


This section is empty.


func FromType

func FromType(t Type) (isClientStream bool, isServerStream bool)

FromType returns the checks if method type is client stream or server stream.

func IsMethodBidirectionalStream

func IsMethodBidirectionalStream(t Type) bool

IsMethodBidirectionalStream checks whether the method is client-and-server-stream.

func IsMethodClientStream

func IsMethodClientStream(t Type) bool

IsMethodClientStream checks whether the method is client-stream.

func IsMethodServerStream

func IsMethodServerStream(t Type) bool

IsMethodServerStream checks whether the method is server-stream.

func IsMethodUnary

func IsMethodUnary(t Type) bool

IsMethodUnary checks whether the method is unary.


type Method

type Method struct {
	ServiceName string
	MethodName  string
	MethodType  Type
	Input       interface{}
	Output      interface{}

Method contains description of a grpc service.

func (Method) FullName

func (m Method) FullName() string

FullName returns the full name of the service method.

type Type

type Type string

Type is service method type.

const (
	// TypeUnary indicates that the method is unary.
	TypeUnary Type = "Unary"
	// TypeClientStream indicates that the method is client-stream.
	TypeClientStream Type = "ClientStream"
	// TypeServerStream indicates that the method is server-stream.
	TypeServerStream Type = "ServerStream"
	// TypeBidirectionalStream indicates that the method is bidirectional-stream.
	TypeBidirectionalStream Type = "BidirectionalStream"

func ToType

func ToType(isClientStream, isServerStream bool) Type

ToType defines the method type by checking if it's a client or server strean.

Source Files

Jump to

Keyboard shortcuts

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