telemetry

package
v0.0.0-...-c43ceac Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package telemetry is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package telemetry is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_location_proto protoreflect.FileDescriptor
View Source
var File_temperature_proto protoreflect.FileDescriptor

Functions

func RegisterLocationsHandler

func RegisterLocationsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterLocationsHandler registers the http handlers for service Locations to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterLocationsHandlerClient

func RegisterLocationsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LocationsClient) error

RegisterLocationsHandlerClient registers the http handlers for service Locations to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "LocationsClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "LocationsClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "LocationsClient" to call the correct interceptors.

func RegisterLocationsHandlerFromEndpoint

func RegisterLocationsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterLocationsHandlerFromEndpoint is same as RegisterLocationsHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterLocationsHandlerServer

func RegisterLocationsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LocationsServer) error

RegisterLocationsHandlerServer registers the http handlers for service Locations to "mux". UnaryRPC :call LocationsServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterLocationsServer

func RegisterLocationsServer(s *grpc.Server, srv LocationsServer)

func RegisterTempsHandler

func RegisterTempsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterTempsHandler registers the http handlers for service Temps to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterTempsHandlerClient

func RegisterTempsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TempsClient) error

RegisterTempsHandlerClient registers the http handlers for service Temps to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TempsClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TempsClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TempsClient" to call the correct interceptors.

func RegisterTempsHandlerFromEndpoint

func RegisterTempsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterTempsHandlerFromEndpoint is same as RegisterTempsHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterTempsHandlerServer

func RegisterTempsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TempsServer) error

RegisterTempsHandlerServer registers the http handlers for service Temps to "mux". UnaryRPC :call TempsServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterTempsServer

func RegisterTempsServer(s *grpc.Server, srv TempsServer)

Types

type GetLocationsResponse

type GetLocationsResponse struct {
	Locations []*Location `protobuf:"bytes,1,rep,name=locations,proto3" json:"locations,omitempty"`
	// contains filtered or unexported fields
}

func (*GetLocationsResponse) Descriptor deprecated

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

Deprecated: Use GetLocationsResponse.ProtoReflect.Descriptor instead.

func (*GetLocationsResponse) GetLocations

func (x *GetLocationsResponse) GetLocations() []*Location

func (*GetLocationsResponse) ProtoMessage

func (*GetLocationsResponse) ProtoMessage()

func (*GetLocationsResponse) ProtoReflect

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

func (*GetLocationsResponse) Reset

func (x *GetLocationsResponse) Reset()

func (*GetLocationsResponse) String

func (x *GetLocationsResponse) String() string

type GetTempsRequest

type GetTempsRequest struct {
	LocationId int32 `protobuf:"varint,1,opt,name=location_id,json=locationId,proto3" json:"location_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTempsRequest) Descriptor deprecated

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

Deprecated: Use GetTempsRequest.ProtoReflect.Descriptor instead.

func (*GetTempsRequest) GetLocationId

func (x *GetTempsRequest) GetLocationId() int32

func (*GetTempsRequest) ProtoMessage

func (*GetTempsRequest) ProtoMessage()

func (*GetTempsRequest) ProtoReflect

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

func (*GetTempsRequest) Reset

func (x *GetTempsRequest) Reset()

func (*GetTempsRequest) String

func (x *GetTempsRequest) String() string

type GetTempsResponse

type GetTempsResponse struct {
	Temps []float32 `protobuf:"fixed32,1,rep,packed,name=temps,proto3" json:"temps,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTempsResponse) Descriptor deprecated

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

Deprecated: Use GetTempsResponse.ProtoReflect.Descriptor instead.

func (*GetTempsResponse) GetTemps

func (x *GetTempsResponse) GetTemps() []float32

func (*GetTempsResponse) ProtoMessage

func (*GetTempsResponse) ProtoMessage()

func (*GetTempsResponse) ProtoReflect

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

func (*GetTempsResponse) Reset

func (x *GetTempsResponse) Reset()

func (*GetTempsResponse) String

func (x *GetTempsResponse) String() string

type Location

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

func (*Location) Descriptor deprecated

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

Deprecated: Use Location.ProtoReflect.Descriptor instead.

func (*Location) GetId

func (x *Location) GetId() int32

func (*Location) GetName

func (x *Location) GetName() string

func (*Location) ProtoMessage

func (*Location) ProtoMessage()

func (*Location) ProtoReflect

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

func (*Location) Reset

func (x *Location) Reset()

func (*Location) String

func (x *Location) String() string

type LocationsClient

type LocationsClient interface {
	GetLocations(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*GetLocationsResponse, error)
	CreateLocation(ctx context.Context, in *Location, opts ...grpc.CallOption) (*Location, error)
}

LocationsClient is the client API for Locations service.

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

func NewLocationsClient

func NewLocationsClient(cc grpc.ClientConnInterface) LocationsClient

type LocationsServer

type LocationsServer interface {
	GetLocations(context.Context, *empty.Empty) (*GetLocationsResponse, error)
	CreateLocation(context.Context, *Location) (*Location, error)
}

LocationsServer is the server API for Locations service.

type Temp

type Temp struct {
	Temp       float32 `protobuf:"fixed32,1,opt,name=temp,proto3" json:"temp,omitempty"`
	LocationId int32   `protobuf:"varint,2,opt,name=location_id,json=locationId,proto3" json:"location_id,omitempty"`
	// contains filtered or unexported fields
}

func (*Temp) Descriptor deprecated

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

Deprecated: Use Temp.ProtoReflect.Descriptor instead.

func (*Temp) GetLocationId

func (x *Temp) GetLocationId() int32

func (*Temp) GetTemp

func (x *Temp) GetTemp() float32

func (*Temp) ProtoMessage

func (*Temp) ProtoMessage()

func (*Temp) ProtoReflect

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

func (*Temp) Reset

func (x *Temp) Reset()

func (*Temp) String

func (x *Temp) String() string

type TempsClient

type TempsClient interface {
	GetTemps(ctx context.Context, in *GetTempsRequest, opts ...grpc.CallOption) (*GetTempsResponse, error)
	CreateTemp(ctx context.Context, in *Temp, opts ...grpc.CallOption) (*empty.Empty, error)
}

TempsClient is the client API for Temps service.

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

func NewTempsClient

func NewTempsClient(cc grpc.ClientConnInterface) TempsClient

type TempsServer

type TempsServer interface {
	GetTemps(context.Context, *GetTempsRequest) (*GetTempsResponse, error)
	CreateTemp(context.Context, *Temp) (*empty.Empty, error)
}

TempsServer is the server API for Temps service.

type UnimplementedLocationsServer

type UnimplementedLocationsServer struct {
}

UnimplementedLocationsServer can be embedded to have forward compatible implementations.

func (*UnimplementedLocationsServer) CreateLocation

func (*UnimplementedLocationsServer) GetLocations

type UnimplementedTempsServer

type UnimplementedTempsServer struct {
}

UnimplementedTempsServer can be embedded to have forward compatible implementations.

func (*UnimplementedTempsServer) CreateTemp

func (*UnimplementedTempsServer) GetTemps

Jump to

Keyboard shortcuts

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