service

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package service provides service definition.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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.

Types

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.

Jump to

Keyboard shortcuts

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