service

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FeedType_name = map[int32]string{
		0: "FEED_TYPE_UNKNOWN",
		1: "FEED_TYPE_RED",
		2: "FEED_TYPE_BLUE",
	}
	FeedType_value = map[string]int32{
		"FEED_TYPE_UNKNOWN": 0,
		"FEED_TYPE_RED":     1,
		"FEED_TYPE_BLUE":    2,
	}
)

Enum value maps for FeedType.

View Source
var File_service_proto protoreflect.FileDescriptor

Functions

func RegisterAppServer added in v0.3.0

func RegisterAppServer(s *grpc.Server, srv AppServer)

func RegisterExposedAppServer added in v0.3.0

func RegisterExposedAppServer(s *grpc.Server, srv ExposedAppServer)

Types

type AppClient added in v0.3.0

type AppClient interface {
	// Fibonacci returns the nth number in the Fibonacci sequence. It does not start with an HTTP method and is therefore not exposed
	Fibonacci(ctx context.Context, in *FibonacciRequest, opts ...grpc.CallOption) (*FibonacciResponse, error)
	// Random returns a random integer in the desired range. It may be accessed via a Get request to the proxy at, for example, /api/Service/Random
	Random(ctx context.Context, in *RandomRequest, opts ...grpc.CallOption) (*RandomResponse, error)
	// UploadPhoto allows the upload of a photo to some persistence store. It may be accessed via  Post request to the proxy at, for example, /api/Service/UploadPhoto
	UploadPhoto(ctx context.Context, in *UploadPhotoRequest, opts ...grpc.CallOption) (*UploadPhotoResponse, error)
	// Feed sends streamed inputs
	Feed(ctx context.Context, opts ...grpc.CallOption) (App_FeedClient, error)
	// Broadcast asks the App to broadcast data in a stream
	Broadcast(ctx context.Context, in *BroadcastRequest, opts ...grpc.CallOption) (App_BroadcastClient, error)
	// ConvertToString streams conversions of the input stream to strings
	ConvertToString(ctx context.Context, opts ...grpc.CallOption) (App_ConvertToStringClient, error)
}

AppClient is the client API for App service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewAppClient added in v0.3.0

func NewAppClient(cc grpc.ClientConnInterface) AppClient

type AppServer added in v0.3.0

type AppServer interface {
	// Fibonacci returns the nth number in the Fibonacci sequence. It does not start with an HTTP method and is therefore not exposed
	Fibonacci(context.Context, *FibonacciRequest) (*FibonacciResponse, error)
	// Random returns a random integer in the desired range. It may be accessed via a Get request to the proxy at, for example, /api/Service/Random
	Random(context.Context, *RandomRequest) (*RandomResponse, error)
	// UploadPhoto allows the upload of a photo to some persistence store. It may be accessed via  Post request to the proxy at, for example, /api/Service/UploadPhoto
	UploadPhoto(context.Context, *UploadPhotoRequest) (*UploadPhotoResponse, error)
	// Feed sends streamed inputs
	Feed(App_FeedServer) error
	// Broadcast asks the App to broadcast data in a stream
	Broadcast(*BroadcastRequest, App_BroadcastServer) error
	// ConvertToString streams conversions of the input stream to strings
	ConvertToString(App_ConvertToStringServer) error
	// contains filtered or unexported methods
}

AppServer is the server API for App service. All implementations must embed UnimplementedAppServer for forward compatibility

type App_BroadcastClient added in v0.4.0

type App_BroadcastClient interface {
	Recv() (*BroadcastData, error)
	grpc.ClientStream
}

type App_BroadcastServer added in v0.4.0

type App_BroadcastServer interface {
	Send(*BroadcastData) error
	grpc.ServerStream
}

type App_ConvertToStringClient added in v0.4.0

type App_ConvertToStringClient interface {
	Send(*ConvertInput) error
	Recv() (*ConvertOutput, error)
	grpc.ClientStream
}

type App_ConvertToStringServer added in v0.4.0

type App_ConvertToStringServer interface {
	Send(*ConvertOutput) error
	Recv() (*ConvertInput, error)
	grpc.ServerStream
}

type App_FeedClient added in v0.4.0

type App_FeedClient interface {
	Send(*FeedData) error
	CloseAndRecv() (*FeedResponse, error)
	grpc.ClientStream
}

type App_FeedServer added in v0.4.0

type App_FeedServer interface {
	SendAndClose(*FeedResponse) error
	Recv() (*FeedData, error)
	grpc.ServerStream
}

type BroadcastData added in v0.4.0

type BroadcastData struct {
	RawData []byte `protobuf:"bytes,1,opt,name=raw_data,json=rawData,proto3" json:"raw_data,omitempty"`
	// contains filtered or unexported fields
}

func (*BroadcastData) Descriptor deprecated added in v0.4.0

func (*BroadcastData) Descriptor() ([]byte, []int)

Deprecated: Use BroadcastData.ProtoReflect.Descriptor instead.

func (*BroadcastData) GetRawData added in v0.4.0

func (x *BroadcastData) GetRawData() []byte

func (*BroadcastData) ProtoMessage added in v0.4.0

func (*BroadcastData) ProtoMessage()

func (*BroadcastData) ProtoReflect added in v0.5.1

func (x *BroadcastData) ProtoReflect() protoreflect.Message

func (*BroadcastData) Reset added in v0.4.0

func (x *BroadcastData) Reset()

func (*BroadcastData) String added in v0.4.0

func (x *BroadcastData) String() string

type BroadcastRequest added in v0.4.0

type BroadcastRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*BroadcastRequest) Descriptor deprecated added in v0.4.0

func (*BroadcastRequest) Descriptor() ([]byte, []int)

Deprecated: Use BroadcastRequest.ProtoReflect.Descriptor instead.

func (*BroadcastRequest) GetId added in v0.4.0

func (x *BroadcastRequest) GetId() string

func (*BroadcastRequest) ProtoMessage added in v0.4.0

func (*BroadcastRequest) ProtoMessage()

func (*BroadcastRequest) ProtoReflect added in v0.5.1

func (x *BroadcastRequest) ProtoReflect() protoreflect.Message

func (*BroadcastRequest) Reset added in v0.4.0

func (x *BroadcastRequest) Reset()

func (*BroadcastRequest) String added in v0.4.0

func (x *BroadcastRequest) String() string

type ConvertInput added in v0.4.0

type ConvertInput struct {
	RawData []byte `protobuf:"bytes,1,opt,name=raw_data,json=rawData,proto3" json:"raw_data,omitempty"`
	// contains filtered or unexported fields
}

func (*ConvertInput) Descriptor deprecated added in v0.4.0

func (*ConvertInput) Descriptor() ([]byte, []int)

Deprecated: Use ConvertInput.ProtoReflect.Descriptor instead.

func (*ConvertInput) GetRawData added in v0.4.0

func (x *ConvertInput) GetRawData() []byte

func (*ConvertInput) ProtoMessage added in v0.4.0

func (*ConvertInput) ProtoMessage()

func (*ConvertInput) ProtoReflect added in v0.5.1

func (x *ConvertInput) ProtoReflect() protoreflect.Message

func (*ConvertInput) Reset added in v0.4.0

func (x *ConvertInput) Reset()

func (*ConvertInput) String added in v0.4.0

func (x *ConvertInput) String() string

type ConvertOutput added in v0.4.0

type ConvertOutput struct {
	ConvertedData string `protobuf:"bytes,1,opt,name=converted_data,json=convertedData,proto3" json:"converted_data,omitempty"`
	// contains filtered or unexported fields
}

func (*ConvertOutput) Descriptor deprecated added in v0.4.0

func (*ConvertOutput) Descriptor() ([]byte, []int)

Deprecated: Use ConvertOutput.ProtoReflect.Descriptor instead.

func (*ConvertOutput) GetConvertedData added in v0.4.0

func (x *ConvertOutput) GetConvertedData() string

func (*ConvertOutput) ProtoMessage added in v0.4.0

func (*ConvertOutput) ProtoMessage()

func (*ConvertOutput) ProtoReflect added in v0.5.1

func (x *ConvertOutput) ProtoReflect() protoreflect.Message

func (*ConvertOutput) Reset added in v0.4.0

func (x *ConvertOutput) Reset()

func (*ConvertOutput) String added in v0.4.0

func (x *ConvertOutput) String() string

type ExposedAppClient added in v0.3.0

type ExposedAppClient interface {
	GetRandom(ctx context.Context, in *RandomRequest, opts ...grpc.CallOption) (*RandomResponse, error)
	PostUploadPhoto(ctx context.Context, in *UploadPhotoRequest, opts ...grpc.CallOption) (*UploadPhotoResponse, error)
	GetFeed(ctx context.Context, opts ...grpc.CallOption) (ExposedApp_GetFeedClient, error)
	GetBroadcast(ctx context.Context, in *BroadcastRequest, opts ...grpc.CallOption) (ExposedApp_GetBroadcastClient, error)
	GetConvertToString(ctx context.Context, opts ...grpc.CallOption) (ExposedApp_GetConvertToStringClient, error)
}

ExposedAppClient is the client API for ExposedApp service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewExposedAppClient added in v0.3.0

func NewExposedAppClient(cc grpc.ClientConnInterface) ExposedAppClient

type ExposedAppServer added in v0.3.0

type ExposedAppServer interface {
	GetRandom(context.Context, *RandomRequest) (*RandomResponse, error)
	PostUploadPhoto(context.Context, *UploadPhotoRequest) (*UploadPhotoResponse, error)
	GetFeed(ExposedApp_GetFeedServer) error
	GetBroadcast(*BroadcastRequest, ExposedApp_GetBroadcastServer) error
	GetConvertToString(ExposedApp_GetConvertToStringServer) error
	// contains filtered or unexported methods
}

ExposedAppServer is the server API for ExposedApp service. All implementations must embed UnimplementedExposedAppServer for forward compatibility

type ExposedApp_GetBroadcastClient added in v0.4.0

type ExposedApp_GetBroadcastClient interface {
	Recv() (*BroadcastData, error)
	grpc.ClientStream
}

type ExposedApp_GetBroadcastServer added in v0.4.0

type ExposedApp_GetBroadcastServer interface {
	Send(*BroadcastData) error
	grpc.ServerStream
}

type ExposedApp_GetConvertToStringClient added in v0.6.0

type ExposedApp_GetConvertToStringClient interface {
	Send(*ConvertInput) error
	Recv() (*ConvertOutput, error)
	grpc.ClientStream
}

type ExposedApp_GetConvertToStringServer added in v0.6.0

type ExposedApp_GetConvertToStringServer interface {
	Send(*ConvertOutput) error
	Recv() (*ConvertInput, error)
	grpc.ServerStream
}

type ExposedApp_GetFeedClient added in v0.6.0

type ExposedApp_GetFeedClient interface {
	Send(*FeedData) error
	CloseAndRecv() (*FeedResponse, error)
	grpc.ClientStream
}

type ExposedApp_GetFeedServer added in v0.6.0

type ExposedApp_GetFeedServer interface {
	SendAndClose(*FeedResponse) error
	Recv() (*FeedData, error)
	grpc.ServerStream
}

type FeedData added in v0.4.0

type FeedData struct {
	Id       string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	DataType uint64   `protobuf:"varint,2,opt,name=data_type,json=dataType,proto3" json:"data_type,omitempty"`
	RawData  []byte   `protobuf:"bytes,3,opt,name=raw_data,json=rawData,proto3" json:"raw_data,omitempty"`
	Type     FeedType `protobuf:"varint,4,opt,name=type,proto3,enum=service.FeedType" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*FeedData) Descriptor deprecated added in v0.4.0

func (*FeedData) Descriptor() ([]byte, []int)

Deprecated: Use FeedData.ProtoReflect.Descriptor instead.

func (*FeedData) GetDataType added in v0.4.0

func (x *FeedData) GetDataType() uint64

func (*FeedData) GetId added in v0.4.0

func (x *FeedData) GetId() string

func (*FeedData) GetRawData added in v0.4.0

func (x *FeedData) GetRawData() []byte

func (*FeedData) GetType added in v0.7.0

func (x *FeedData) GetType() FeedType

func (*FeedData) ProtoMessage added in v0.4.0

func (*FeedData) ProtoMessage()

func (*FeedData) ProtoReflect added in v0.5.1

func (x *FeedData) ProtoReflect() protoreflect.Message

func (*FeedData) Reset added in v0.4.0

func (x *FeedData) Reset()

func (*FeedData) String added in v0.4.0

func (x *FeedData) String() string

type FeedResponse added in v0.4.0

type FeedResponse struct {
	Received int32 `protobuf:"varint,1,opt,name=received,proto3" json:"received,omitempty"`
	// contains filtered or unexported fields
}

func (*FeedResponse) Descriptor deprecated added in v0.4.0

func (*FeedResponse) Descriptor() ([]byte, []int)

Deprecated: Use FeedResponse.ProtoReflect.Descriptor instead.

func (*FeedResponse) GetReceived added in v0.6.0

func (x *FeedResponse) GetReceived() int32

func (*FeedResponse) ProtoMessage added in v0.4.0

func (*FeedResponse) ProtoMessage()

func (*FeedResponse) ProtoReflect added in v0.5.1

func (x *FeedResponse) ProtoReflect() protoreflect.Message

func (*FeedResponse) Reset added in v0.4.0

func (x *FeedResponse) Reset()

func (*FeedResponse) String added in v0.4.0

func (x *FeedResponse) String() string

type FeedType added in v0.7.0

type FeedType int32
const (
	FeedType_FEED_TYPE_UNKNOWN FeedType = 0
	FeedType_FEED_TYPE_RED     FeedType = 1
	FeedType_FEED_TYPE_BLUE    FeedType = 2
)

func (FeedType) Descriptor added in v0.7.0

func (FeedType) Descriptor() protoreflect.EnumDescriptor

func (FeedType) Enum added in v0.7.0

func (x FeedType) Enum() *FeedType

func (FeedType) EnumDescriptor deprecated added in v0.7.0

func (FeedType) EnumDescriptor() ([]byte, []int)

Deprecated: Use FeedType.Descriptor instead.

func (FeedType) Number added in v0.7.0

func (x FeedType) Number() protoreflect.EnumNumber

func (FeedType) String added in v0.7.0

func (x FeedType) String() string

func (FeedType) Type added in v0.7.0

type FibonacciRequest

type FibonacciRequest struct {

	// The 1-indexed point in the Fibonacci sequence
	N uint64 `protobuf:"varint,1,opt,name=n,proto3" json:"n,omitempty"`
	// contains filtered or unexported fields
}

func (*FibonacciRequest) Descriptor deprecated

func (*FibonacciRequest) Descriptor() ([]byte, []int)

Deprecated: Use FibonacciRequest.ProtoReflect.Descriptor instead.

func (*FibonacciRequest) GetN

func (x *FibonacciRequest) GetN() uint64

func (*FibonacciRequest) ProtoMessage

func (*FibonacciRequest) ProtoMessage()

func (*FibonacciRequest) ProtoReflect added in v0.5.1

func (x *FibonacciRequest) ProtoReflect() protoreflect.Message

func (*FibonacciRequest) Reset

func (x *FibonacciRequest) Reset()

func (*FibonacciRequest) String

func (x *FibonacciRequest) String() string

type FibonacciResponse

type FibonacciResponse struct {

	// The number found in the nth place of the sequence
	Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"`
	// contains filtered or unexported fields
}

func (*FibonacciResponse) Descriptor deprecated

func (*FibonacciResponse) Descriptor() ([]byte, []int)

Deprecated: Use FibonacciResponse.ProtoReflect.Descriptor instead.

func (*FibonacciResponse) GetNumber

func (x *FibonacciResponse) GetNumber() uint64

func (*FibonacciResponse) ProtoMessage

func (*FibonacciResponse) ProtoMessage()

func (*FibonacciResponse) ProtoReflect added in v0.5.1

func (x *FibonacciResponse) ProtoReflect() protoreflect.Message

func (*FibonacciResponse) Reset

func (x *FibonacciResponse) Reset()

func (*FibonacciResponse) String

func (x *FibonacciResponse) String() string

type Handle

type Handle struct {
	UnimplementedAppServer
	// contains filtered or unexported fields
}

Handle is an example GRPC server for a microservice

func New

func New() (*Handle, error)

New creates a new server

func (*Handle) Broadcast added in v0.4.0

func (h *Handle) Broadcast(in *BroadcastRequest, stream App_BroadcastServer) error

Broadcast asks the App to broadcast data in a stream

func (*Handle) ConvertToString added in v0.4.0

func (h *Handle) ConvertToString(stream App_ConvertToStringServer) error

ConvertToString streams conversions of the input stream to strings

func (*Handle) Feed added in v0.4.0

func (h *Handle) Feed(stream App_FeedServer) error

Feed handles streamed inputs

func (*Handle) Fibonacci

func (h *Handle) Fibonacci(ctx context.Context, in *FibonacciRequest) (*FibonacciResponse, error)

Fibonacci returns the nth number in the Fibonacci sequence. It does not start with an HTTP method and is therefore not exposed

func (*Handle) MakeClientConn

func (h *Handle) MakeClientConn() (*grpc.ClientConn, error)

MakeClientConn returns a client connection to this service

func (*Handle) Random

func (h *Handle) Random(ctx context.Context, in *RandomRequest) (*RandomResponse, error)

Random returns a random integer in the desired range. It may be accessed via a Get request to the proxy at, for example, /api/Service/Random

func (*Handle) Start

func (h *Handle) Start() error

Start starts the server

func (*Handle) Stop

func (h *Handle) Stop()

Stop stops the server

func (*Handle) UploadPhoto

func (h *Handle) UploadPhoto(ctx context.Context, in *UploadPhotoRequest) (*UploadPhotoResponse, error)

UploadPhoto allows the upload of a photo to some persistence store. It may be accessed via Post request to the proxy at, for example, /api/Service/UploadPhoto

type RandomRequest

type RandomRequest struct {

	// The lowest inclusive integer for the resulting random number
	LowerBound int64 `protobuf:"varint,1,opt,name=lower_bound,json=lowerBound,proto3" json:"lower_bound,omitempty"`
	// The highest inclusive integer for the resulting random number
	UpperBound int64 `protobuf:"varint,2,opt,name=upper_bound,json=upperBound,proto3" json:"upper_bound,omitempty"`
	// contains filtered or unexported fields
}

func (*RandomRequest) Descriptor deprecated

func (*RandomRequest) Descriptor() ([]byte, []int)

Deprecated: Use RandomRequest.ProtoReflect.Descriptor instead.

func (*RandomRequest) GetLowerBound

func (x *RandomRequest) GetLowerBound() int64

func (*RandomRequest) GetUpperBound

func (x *RandomRequest) GetUpperBound() int64

func (*RandomRequest) ProtoMessage

func (*RandomRequest) ProtoMessage()

func (*RandomRequest) ProtoReflect added in v0.5.1

func (x *RandomRequest) ProtoReflect() protoreflect.Message

func (*RandomRequest) Reset

func (x *RandomRequest) Reset()

func (*RandomRequest) String

func (x *RandomRequest) String() string

type RandomResponse

type RandomResponse struct {

	// The generated number
	Number int64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"`
	// contains filtered or unexported fields
}

func (*RandomResponse) Descriptor deprecated

func (*RandomResponse) Descriptor() ([]byte, []int)

Deprecated: Use RandomResponse.ProtoReflect.Descriptor instead.

func (*RandomResponse) GetNumber

func (x *RandomResponse) GetNumber() int64

func (*RandomResponse) ProtoMessage

func (*RandomResponse) ProtoMessage()

func (*RandomResponse) ProtoReflect added in v0.5.1

func (x *RandomResponse) ProtoReflect() protoreflect.Message

func (*RandomResponse) Reset

func (x *RandomResponse) Reset()

func (*RandomResponse) String

func (x *RandomResponse) String() string

type UnimplementedAppServer added in v0.3.0

type UnimplementedAppServer struct {
}

UnimplementedAppServer must be embedded to have forward compatible implementations.

func (UnimplementedAppServer) Broadcast added in v0.4.0

func (UnimplementedAppServer) ConvertToString added in v0.4.0

func (UnimplementedAppServer) Feed added in v0.4.0

func (UnimplementedAppServer) Fibonacci added in v0.3.0

func (UnimplementedAppServer) Random added in v0.3.0

func (UnimplementedAppServer) UploadPhoto added in v0.3.0

type UnimplementedExposedAppServer added in v0.3.0

type UnimplementedExposedAppServer struct {
}

UnimplementedExposedAppServer must be embedded to have forward compatible implementations.

func (UnimplementedExposedAppServer) GetBroadcast added in v0.4.0

func (UnimplementedExposedAppServer) GetConvertToString added in v0.6.0

func (UnimplementedExposedAppServer) GetFeed added in v0.6.0

func (UnimplementedExposedAppServer) GetRandom added in v0.3.0

func (UnimplementedExposedAppServer) PostUploadPhoto added in v0.3.0

type UnsafeAppServer added in v0.6.0

type UnsafeAppServer interface {
	// contains filtered or unexported methods
}

UnsafeAppServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AppServer will result in compilation errors.

type UnsafeExposedAppServer added in v0.6.0

type UnsafeExposedAppServer interface {
	// contains filtered or unexported methods
}

UnsafeExposedAppServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ExposedAppServer will result in compilation errors.

type UploadPhotoRequest

type UploadPhotoRequest struct {

	// The raw bytes of the photo
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*UploadPhotoRequest) Descriptor deprecated

func (*UploadPhotoRequest) Descriptor() ([]byte, []int)

Deprecated: Use UploadPhotoRequest.ProtoReflect.Descriptor instead.

func (*UploadPhotoRequest) GetData

func (x *UploadPhotoRequest) GetData() []byte

func (*UploadPhotoRequest) ProtoMessage

func (*UploadPhotoRequest) ProtoMessage()

func (*UploadPhotoRequest) ProtoReflect added in v0.5.1

func (x *UploadPhotoRequest) ProtoReflect() protoreflect.Message

func (*UploadPhotoRequest) Reset

func (x *UploadPhotoRequest) Reset()

func (*UploadPhotoRequest) String

func (x *UploadPhotoRequest) String() string

type UploadPhotoResponse

type UploadPhotoResponse struct {

	// The uuid generated to identify and retreive this photo
	Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	// contains filtered or unexported fields
}

func (*UploadPhotoResponse) Descriptor deprecated

func (*UploadPhotoResponse) Descriptor() ([]byte, []int)

Deprecated: Use UploadPhotoResponse.ProtoReflect.Descriptor instead.

func (*UploadPhotoResponse) GetUuid

func (x *UploadPhotoResponse) GetUuid() string

func (*UploadPhotoResponse) ProtoMessage

func (*UploadPhotoResponse) ProtoMessage()

func (*UploadPhotoResponse) ProtoReflect added in v0.5.1

func (x *UploadPhotoResponse) ProtoReflect() protoreflect.Message

func (*UploadPhotoResponse) Reset

func (x *UploadPhotoResponse) Reset()

func (*UploadPhotoResponse) String

func (x *UploadPhotoResponse) String() string

Jump to

Keyboard shortcuts

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