service

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterExposedServiceServer

func RegisterExposedServiceServer(s *grpc.Server, srv ExposedServiceServer)

func RegisterServiceServer

func RegisterServiceServer(s *grpc.Server, srv ServiceServer)

Types

type ExposedServiceClient

type ExposedServiceClient interface {
	GetRandom(ctx context.Context, in *RandomRequest, opts ...grpc.CallOption) (*RandomResponse, error)
	PostUploadPhoto(ctx context.Context, in *UploadPhotoRequest, opts ...grpc.CallOption) (*UploadPhotoResponse, error)
}

ExposedServiceClient is the client API for ExposedService service.

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

func NewExposedServiceClient

func NewExposedServiceClient(cc *grpc.ClientConn) ExposedServiceClient

type ExposedServiceServer

type ExposedServiceServer interface {
	GetRandom(context.Context, *RandomRequest) (*RandomResponse, error)
	PostUploadPhoto(context.Context, *UploadPhotoRequest) (*UploadPhotoResponse, error)
}

ExposedServiceServer is the server API for ExposedService service.

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*FibonacciRequest) Descriptor

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

func (*FibonacciRequest) GetN

func (m *FibonacciRequest) GetN() uint64

func (*FibonacciRequest) ProtoMessage

func (*FibonacciRequest) ProtoMessage()

func (*FibonacciRequest) Reset

func (m *FibonacciRequest) Reset()

func (*FibonacciRequest) String

func (m *FibonacciRequest) String() string

func (*FibonacciRequest) XXX_DiscardUnknown

func (m *FibonacciRequest) XXX_DiscardUnknown()

func (*FibonacciRequest) XXX_Marshal

func (m *FibonacciRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FibonacciRequest) XXX_Merge

func (m *FibonacciRequest) XXX_Merge(src proto.Message)

func (*FibonacciRequest) XXX_Size

func (m *FibonacciRequest) XXX_Size() int

func (*FibonacciRequest) XXX_Unmarshal

func (m *FibonacciRequest) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*FibonacciResponse) Descriptor

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

func (*FibonacciResponse) GetNumber

func (m *FibonacciResponse) GetNumber() uint64

func (*FibonacciResponse) ProtoMessage

func (*FibonacciResponse) ProtoMessage()

func (*FibonacciResponse) Reset

func (m *FibonacciResponse) Reset()

func (*FibonacciResponse) String

func (m *FibonacciResponse) String() string

func (*FibonacciResponse) XXX_DiscardUnknown

func (m *FibonacciResponse) XXX_DiscardUnknown()

func (*FibonacciResponse) XXX_Marshal

func (m *FibonacciResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FibonacciResponse) XXX_Merge

func (m *FibonacciResponse) XXX_Merge(src proto.Message)

func (*FibonacciResponse) XXX_Size

func (m *FibonacciResponse) XXX_Size() int

func (*FibonacciResponse) XXX_Unmarshal

func (m *FibonacciResponse) XXX_Unmarshal(b []byte) error

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) 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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RandomRequest) Descriptor

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

func (*RandomRequest) GetLowerBound

func (m *RandomRequest) GetLowerBound() int64

func (*RandomRequest) GetUpperBound

func (m *RandomRequest) GetUpperBound() int64

func (*RandomRequest) ProtoMessage

func (*RandomRequest) ProtoMessage()

func (*RandomRequest) Reset

func (m *RandomRequest) Reset()

func (*RandomRequest) String

func (m *RandomRequest) String() string

func (*RandomRequest) XXX_DiscardUnknown

func (m *RandomRequest) XXX_DiscardUnknown()

func (*RandomRequest) XXX_Marshal

func (m *RandomRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RandomRequest) XXX_Merge

func (m *RandomRequest) XXX_Merge(src proto.Message)

func (*RandomRequest) XXX_Size

func (m *RandomRequest) XXX_Size() int

func (*RandomRequest) XXX_Unmarshal

func (m *RandomRequest) XXX_Unmarshal(b []byte) error

type RandomResponse

type RandomResponse struct {
	// The generated number
	Number               int64    `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*RandomResponse) Descriptor

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

func (*RandomResponse) GetNumber

func (m *RandomResponse) GetNumber() int64

func (*RandomResponse) ProtoMessage

func (*RandomResponse) ProtoMessage()

func (*RandomResponse) Reset

func (m *RandomResponse) Reset()

func (*RandomResponse) String

func (m *RandomResponse) String() string

func (*RandomResponse) XXX_DiscardUnknown

func (m *RandomResponse) XXX_DiscardUnknown()

func (*RandomResponse) XXX_Marshal

func (m *RandomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RandomResponse) XXX_Merge

func (m *RandomResponse) XXX_Merge(src proto.Message)

func (*RandomResponse) XXX_Size

func (m *RandomResponse) XXX_Size() int

func (*RandomResponse) XXX_Unmarshal

func (m *RandomResponse) XXX_Unmarshal(b []byte) error

type ServiceClient

type ServiceClient 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)
}

ServiceClient is the client API for Service service.

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

func NewServiceClient

func NewServiceClient(cc *grpc.ClientConn) ServiceClient

type ServiceServer

type ServiceServer 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)
}

ServiceServer is the server API for Service service.

type UnimplementedExposedServiceServer

type UnimplementedExposedServiceServer struct {
}

UnimplementedExposedServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedExposedServiceServer) GetRandom

func (*UnimplementedExposedServiceServer) PostUploadPhoto

type UnimplementedServiceServer

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedServiceServer) Fibonacci

func (*UnimplementedServiceServer) Random

func (*UnimplementedServiceServer) UploadPhoto

type UploadPhotoRequest

type UploadPhotoRequest struct {
	// The raw bytes of the photo
	Data                 []byte   `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*UploadPhotoRequest) Descriptor

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

func (*UploadPhotoRequest) GetData

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

func (*UploadPhotoRequest) ProtoMessage

func (*UploadPhotoRequest) ProtoMessage()

func (*UploadPhotoRequest) Reset

func (m *UploadPhotoRequest) Reset()

func (*UploadPhotoRequest) String

func (m *UploadPhotoRequest) String() string

func (*UploadPhotoRequest) XXX_DiscardUnknown

func (m *UploadPhotoRequest) XXX_DiscardUnknown()

func (*UploadPhotoRequest) XXX_Marshal

func (m *UploadPhotoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UploadPhotoRequest) XXX_Merge

func (m *UploadPhotoRequest) XXX_Merge(src proto.Message)

func (*UploadPhotoRequest) XXX_Size

func (m *UploadPhotoRequest) XXX_Size() int

func (*UploadPhotoRequest) XXX_Unmarshal

func (m *UploadPhotoRequest) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*UploadPhotoResponse) Descriptor

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

func (*UploadPhotoResponse) GetUuid

func (m *UploadPhotoResponse) GetUuid() string

func (*UploadPhotoResponse) ProtoMessage

func (*UploadPhotoResponse) ProtoMessage()

func (*UploadPhotoResponse) Reset

func (m *UploadPhotoResponse) Reset()

func (*UploadPhotoResponse) String

func (m *UploadPhotoResponse) String() string

func (*UploadPhotoResponse) XXX_DiscardUnknown

func (m *UploadPhotoResponse) XXX_DiscardUnknown()

func (*UploadPhotoResponse) XXX_Marshal

func (m *UploadPhotoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UploadPhotoResponse) XXX_Merge

func (m *UploadPhotoResponse) XXX_Merge(src proto.Message)

func (*UploadPhotoResponse) XXX_Size

func (m *UploadPhotoResponse) XXX_Size() int

func (*UploadPhotoResponse) XXX_Unmarshal

func (m *UploadPhotoResponse) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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