pob

package
v0.0.0-...-174759b Latest Latest
Warning

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

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

Documentation

Overview

Package pob is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_device_proto protoreflect.FileDescriptor
View Source
var File_greet_proto protoreflect.FileDescriptor

Functions

func RegisterGreetServiceServer

func RegisterGreetServiceServer(s *grpc.Server, srv GreetServiceServer)

func RegisterManageDeviceHandler

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

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

func RegisterManageDeviceHandlerClient

func RegisterManageDeviceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ManageDeviceClient) error

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

func RegisterManageDeviceHandlerFromEndpoint

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

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

func RegisterManageDeviceHandlerServer

func RegisterManageDeviceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ManageDeviceServer) error

RegisterManageDeviceHandlerServer registers the http handlers for service ManageDevice to "mux". UnaryRPC :call ManageDeviceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterManageDeviceHandlerFromEndpoint instead.

func RegisterManageDeviceServer

func RegisterManageDeviceServer(s grpc.ServiceRegistrar, srv ManageDeviceServer)

Types

type CPAccessPolicy

type CPAccessPolicy struct {
	PortalAccounts []*CPAccessPolicy_PortalAccounts `protobuf:"bytes,1,rep,name=portalAccounts,proto3" json:"portalAccounts,omitempty"`
	// contains filtered or unexported fields
}

func (*CPAccessPolicy) Descriptor deprecated

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

Deprecated: Use CPAccessPolicy.ProtoReflect.Descriptor instead.

func (*CPAccessPolicy) GetPortalAccounts

func (x *CPAccessPolicy) GetPortalAccounts() []*CPAccessPolicy_PortalAccounts

func (*CPAccessPolicy) ProtoMessage

func (*CPAccessPolicy) ProtoMessage()

func (*CPAccessPolicy) ProtoReflect

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

func (*CPAccessPolicy) Reset

func (x *CPAccessPolicy) Reset()

func (*CPAccessPolicy) String

func (x *CPAccessPolicy) String() string

type CPAccessPolicy_PortalAccounts

type CPAccessPolicy_PortalAccounts struct {
	CustomerId string                                    `protobuf:"bytes,1,opt,name=customerId,proto3" json:"customerId,omitempty"`
	Policies   []*CPAccessPolicy_PortalAccounts_Policies `protobuf:"bytes,2,rep,name=policies,proto3" json:"policies,omitempty"`
	// contains filtered or unexported fields
}

func (*CPAccessPolicy_PortalAccounts) Descriptor deprecated

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

Deprecated: Use CPAccessPolicy_PortalAccounts.ProtoReflect.Descriptor instead.

func (*CPAccessPolicy_PortalAccounts) GetCustomerId

func (x *CPAccessPolicy_PortalAccounts) GetCustomerId() string

func (*CPAccessPolicy_PortalAccounts) GetPolicies

func (*CPAccessPolicy_PortalAccounts) ProtoMessage

func (*CPAccessPolicy_PortalAccounts) ProtoMessage()

func (*CPAccessPolicy_PortalAccounts) ProtoReflect

func (*CPAccessPolicy_PortalAccounts) Reset

func (x *CPAccessPolicy_PortalAccounts) Reset()

func (*CPAccessPolicy_PortalAccounts) String

type CPAccessPolicy_PortalAccounts_Policies

type CPAccessPolicy_PortalAccounts_Policies struct {
	Role        string                                                `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"`
	AssetGroups []*CPAccessPolicy_PortalAccounts_Policies_AssetGroups `protobuf:"bytes,2,rep,name=assetGroups,proto3" json:"assetGroups,omitempty"`
	// contains filtered or unexported fields
}

func (*CPAccessPolicy_PortalAccounts_Policies) Descriptor deprecated

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

Deprecated: Use CPAccessPolicy_PortalAccounts_Policies.ProtoReflect.Descriptor instead.

func (*CPAccessPolicy_PortalAccounts_Policies) GetAssetGroups

func (*CPAccessPolicy_PortalAccounts_Policies) GetRole

func (*CPAccessPolicy_PortalAccounts_Policies) ProtoMessage

func (*CPAccessPolicy_PortalAccounts_Policies) ProtoReflect

func (*CPAccessPolicy_PortalAccounts_Policies) Reset

func (*CPAccessPolicy_PortalAccounts_Policies) String

type CPAccessPolicy_PortalAccounts_Policies_AssetGroups

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

func (*CPAccessPolicy_PortalAccounts_Policies_AssetGroups) Descriptor deprecated

Deprecated: Use CPAccessPolicy_PortalAccounts_Policies_AssetGroups.ProtoReflect.Descriptor instead.

func (*CPAccessPolicy_PortalAccounts_Policies_AssetGroups) GetId

func (*CPAccessPolicy_PortalAccounts_Policies_AssetGroups) GetName

func (*CPAccessPolicy_PortalAccounts_Policies_AssetGroups) ProtoMessage

func (*CPAccessPolicy_PortalAccounts_Policies_AssetGroups) ProtoReflect

func (*CPAccessPolicy_PortalAccounts_Policies_AssetGroups) Reset

func (*CPAccessPolicy_PortalAccounts_Policies_AssetGroups) String

type DeviceDetails

type DeviceDetails struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*DeviceDetails) Descriptor deprecated

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

Deprecated: Use DeviceDetails.ProtoReflect.Descriptor instead.

func (*DeviceDetails) GetName

func (x *DeviceDetails) GetName() string

func (*DeviceDetails) GetType

func (x *DeviceDetails) GetType() string

func (*DeviceDetails) ProtoMessage

func (*DeviceDetails) ProtoMessage()

func (*DeviceDetails) ProtoReflect

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

func (*DeviceDetails) Reset

func (x *DeviceDetails) Reset()

func (*DeviceDetails) String

func (x *DeviceDetails) String() string

type DeviceInfo

type DeviceInfo struct {
	Ip   string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"`
	Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*DeviceInfo) Descriptor deprecated

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

Deprecated: Use DeviceInfo.ProtoReflect.Descriptor instead.

func (*DeviceInfo) GetIp

func (x *DeviceInfo) GetIp() string

func (*DeviceInfo) GetType

func (x *DeviceInfo) GetType() string

func (*DeviceInfo) ProtoMessage

func (*DeviceInfo) ProtoMessage()

func (*DeviceInfo) ProtoReflect

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

func (*DeviceInfo) Reset

func (x *DeviceInfo) Reset()

func (*DeviceInfo) String

func (x *DeviceInfo) String() string

type DeviceRequest

type DeviceRequest struct {
	DeviceInfo *DeviceInfo `protobuf:"bytes,1,opt,name=deviceInfo,proto3" json:"deviceInfo,omitempty"`
	// contains filtered or unexported fields
}

func (*DeviceRequest) Descriptor deprecated

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

Deprecated: Use DeviceRequest.ProtoReflect.Descriptor instead.

func (*DeviceRequest) GetDeviceInfo

func (x *DeviceRequest) GetDeviceInfo() *DeviceInfo

func (*DeviceRequest) ProtoMessage

func (*DeviceRequest) ProtoMessage()

func (*DeviceRequest) ProtoReflect

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

func (*DeviceRequest) Reset

func (x *DeviceRequest) Reset()

func (*DeviceRequest) String

func (x *DeviceRequest) String() string

type DeviceResponse

type DeviceResponse struct {
	DevDetails *DeviceDetails `protobuf:"bytes,1,opt,name=devDetails,proto3" json:"devDetails,omitempty"`
	// contains filtered or unexported fields
}

func (*DeviceResponse) Descriptor deprecated

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

Deprecated: Use DeviceResponse.ProtoReflect.Descriptor instead.

func (*DeviceResponse) GetDevDetails

func (x *DeviceResponse) GetDevDetails() *DeviceDetails

func (*DeviceResponse) ProtoMessage

func (*DeviceResponse) ProtoMessage()

func (*DeviceResponse) ProtoReflect

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

func (*DeviceResponse) Reset

func (x *DeviceResponse) Reset()

func (*DeviceResponse) String

func (x *DeviceResponse) String() string

type GreetRequest

type GreetRequest struct {
	Fname string `protobuf:"bytes,1,opt,name=fname,proto3" json:"fname,omitempty"`
	Lname string `protobuf:"bytes,2,opt,name=lname,proto3" json:"lname,omitempty"`
	// contains filtered or unexported fields
}

func (*GreetRequest) Descriptor deprecated

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

Deprecated: Use GreetRequest.ProtoReflect.Descriptor instead.

func (*GreetRequest) GetFname

func (x *GreetRequest) GetFname() string

func (*GreetRequest) GetLname

func (x *GreetRequest) GetLname() string

func (*GreetRequest) ProtoMessage

func (*GreetRequest) ProtoMessage()

func (*GreetRequest) ProtoReflect

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

func (*GreetRequest) Reset

func (x *GreetRequest) Reset()

func (*GreetRequest) String

func (x *GreetRequest) String() string

type GreetResponse

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

func (*GreetResponse) Descriptor deprecated

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

Deprecated: Use GreetResponse.ProtoReflect.Descriptor instead.

func (*GreetResponse) GetGreet

func (x *GreetResponse) GetGreet() string

func (*GreetResponse) ProtoMessage

func (*GreetResponse) ProtoMessage()

func (*GreetResponse) ProtoReflect

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

func (*GreetResponse) Reset

func (x *GreetResponse) Reset()

func (*GreetResponse) String

func (x *GreetResponse) String() string

type GreetServiceClient

type GreetServiceClient interface {
	Greet(ctx context.Context, in *GreetRequest, opts ...grpc.CallOption) (*GreetResponse, error)
	Recipes(ctx context.Context, in *RecipeRequest, opts ...grpc.CallOption) (*RecipeResponse, error)
}

GreetServiceClient is the client API for GreetService 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.

type GreetServiceServer

type GreetServiceServer interface {
	Greet(context.Context, *GreetRequest) (*GreetResponse, error)
	Recipes(context.Context, *RecipeRequest) (*RecipeResponse, error)
	// contains filtered or unexported methods
}

GreetServiceServer is the server API for GreetService service. All implementations must embed UnimplementedGreetServiceServer for forward compatibility

type ManageDeviceClient

type ManageDeviceClient interface {
	ManagedDevice(ctx context.Context, in *DeviceRequest, opts ...grpc.CallOption) (*DeviceResponse, error)
}

ManageDeviceClient is the client API for ManageDevice 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.

type ManageDeviceServer

type ManageDeviceServer interface {
	ManagedDevice(context.Context, *DeviceRequest) (*DeviceResponse, error)
	// contains filtered or unexported methods
}

ManageDeviceServer is the server API for ManageDevice service. All implementations must embed UnimplementedManageDeviceServer for forward compatibility

type RecipeRequest

type RecipeRequest struct {
	Name           string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	DurationInHour int64  `protobuf:"varint,2,opt,name=durationInHour,proto3" json:"durationInHour,omitempty"`
	// contains filtered or unexported fields
}

func (*RecipeRequest) Descriptor deprecated

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

Deprecated: Use RecipeRequest.ProtoReflect.Descriptor instead.

func (*RecipeRequest) GetDurationInHour

func (x *RecipeRequest) GetDurationInHour() int64

func (*RecipeRequest) GetName

func (x *RecipeRequest) GetName() string

func (*RecipeRequest) ProtoMessage

func (*RecipeRequest) ProtoMessage()

func (*RecipeRequest) ProtoReflect

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

func (*RecipeRequest) Reset

func (x *RecipeRequest) Reset()

func (*RecipeRequest) String

func (x *RecipeRequest) String() string

type RecipeResponse

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

func (*RecipeResponse) Descriptor deprecated

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

Deprecated: Use RecipeResponse.ProtoReflect.Descriptor instead.

func (*RecipeResponse) GetTaste

func (x *RecipeResponse) GetTaste() string

func (*RecipeResponse) ProtoMessage

func (*RecipeResponse) ProtoMessage()

func (*RecipeResponse) ProtoReflect

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

func (*RecipeResponse) Reset

func (x *RecipeResponse) Reset()

func (*RecipeResponse) String

func (x *RecipeResponse) String() string

type Task

type Task struct {
	Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	Done bool   `protobuf:"varint,2,opt,name=done,proto3" json:"done,omitempty"`
	// contains filtered or unexported fields
}

func (*Task) Descriptor deprecated

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

Deprecated: Use Task.ProtoReflect.Descriptor instead.

func (*Task) GetDone

func (x *Task) GetDone() bool

func (*Task) GetText

func (x *Task) GetText() string

func (*Task) ProtoMessage

func (*Task) ProtoMessage()

func (*Task) ProtoReflect

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

func (*Task) Reset

func (x *Task) Reset()

func (*Task) String

func (x *Task) String() string

type UnimplementedGreetServiceServer

type UnimplementedGreetServiceServer struct {
}

UnimplementedGreetServiceServer must be embedded to have forward compatible implementations.

func (*UnimplementedGreetServiceServer) Greet

func (*UnimplementedGreetServiceServer) Recipes

type UnimplementedManageDeviceServer

type UnimplementedManageDeviceServer struct {
}

UnimplementedManageDeviceServer must be embedded to have forward compatible implementations.

func (UnimplementedManageDeviceServer) ManagedDevice

type UnsafeManageDeviceServer

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

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

Jump to

Keyboard shortcuts

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