service

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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://godoc.org/google.golang.org/grpc#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
}

AppServer is the server API for App service.

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)
	PostFeed(ctx context.Context, opts ...grpc.CallOption) (ExposedApp_PostFeedClient, error)
	GetBroadcast(ctx context.Context, in *BroadcastRequest, opts ...grpc.CallOption) (ExposedApp_GetBroadcastClient, error)
	PostConvertToString(ctx context.Context, opts ...grpc.CallOption) (ExposedApp_PostConvertToStringClient, error)
}

ExposedAppClient is the client API for ExposedApp service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewExposedAppClient added in v0.3.0

func NewExposedAppClient(cc grpc.ClientConnInterface) ExposedAppClient

type ExposedAppServer added in v0.3.0

ExposedAppServer is the server API for ExposedApp service.

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_PostConvertToStringClient added in v0.4.0

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

type ExposedApp_PostConvertToStringServer added in v0.4.0

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

type ExposedApp_PostFeedClient added in v0.4.0

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

type ExposedApp_PostFeedServer added in v0.4.0

type ExposedApp_PostFeedServer 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"`
	// 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) 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 {
	// 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) 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 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 {
	// 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 can 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 can be embedded to have forward compatible implementations.

func (*UnimplementedExposedAppServer) GetBroadcast added in v0.4.0

func (*UnimplementedExposedAppServer) GetRandom added in v0.3.0

func (*UnimplementedExposedAppServer) PostConvertToString added in v0.4.0

func (*UnimplementedExposedAppServer) PostFeed added in v0.4.0

func (*UnimplementedExposedAppServer) PostUploadPhoto added in v0.3.0

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