Documentation ¶
Overview ¶
Package license is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterLicenseServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterLicenseServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LicenseServiceClient) error
- func RegisterLicenseServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterLicenseServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LicenseServiceServer) error
- func RegisterLicenseServiceServer(s *grpc.Server, srv LicenseServiceServer)
- type LicensePayload
- type LicenseRequest
- type LicenseResponse
- func (*LicenseResponse) Descriptor() ([]byte, []int)deprecated
- func (x *LicenseResponse) GetExpiryDate() int64
- func (x *LicenseResponse) GetFeatures() map[string]string
- func (x *LicenseResponse) GetMessage() string
- func (x *LicenseResponse) GetStatus() Status
- func (x *LicenseResponse) GetType() LicenseType
- func (*LicenseResponse) ProtoMessage()
- func (x *LicenseResponse) ProtoReflect() protoreflect.Message
- func (x *LicenseResponse) Reset()
- func (x *LicenseResponse) String() string
- type LicenseServiceClient
- type LicenseServiceServer
- type LicenseType
- func (LicenseType) Descriptor() protoreflect.EnumDescriptor
- func (x LicenseType) Enum() *LicenseType
- func (LicenseType) EnumDescriptor() ([]byte, []int)deprecated
- func (x LicenseType) Number() protoreflect.EnumNumber
- func (x LicenseType) String() string
- func (LicenseType) Type() protoreflect.EnumType
- type Status
- type UnimplementedLicenseServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( Status_name = map[int32]string{ 0: "notFound", 1: "expired", 2: "aboutToExpire", 3: "valid", } Status_value = map[string]int32{ "notFound": 0, "expired": 1, "aboutToExpire": 2, "valid": 3, } )
Enum value maps for Status.
var ( LicenseType_name = map[int32]string{ 0: "trial", 1: "pro", 2: "ami", } LicenseType_value = map[string]int32{ "trial": 0, "pro": 1, "ami": 2, } )
Enum value maps for LicenseType.
var File_api_proto_license_proto protoreflect.FileDescriptor
Functions ¶
func RegisterLicenseServiceHandler ¶
func RegisterLicenseServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterLicenseServiceHandler registers the http handlers for service LicenseService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterLicenseServiceHandlerClient ¶
func RegisterLicenseServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LicenseServiceClient) error
RegisterLicenseServiceHandlerClient registers the http handlers for service LicenseService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "LicenseServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "LicenseServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "LicenseServiceClient" to call the correct interceptors.
func RegisterLicenseServiceHandlerFromEndpoint ¶
func RegisterLicenseServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterLicenseServiceHandlerFromEndpoint is same as RegisterLicenseServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterLicenseServiceHandlerServer ¶
func RegisterLicenseServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LicenseServiceServer) error
RegisterLicenseServiceHandlerServer registers the http handlers for service LicenseService to "mux". UnaryRPC :call LicenseServiceServer 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 RegisterLicenseServiceHandlerFromEndpoint instead.
func RegisterLicenseServiceServer ¶
func RegisterLicenseServiceServer(s *grpc.Server, srv LicenseServiceServer)
Types ¶
type LicensePayload ¶
type LicensePayload struct { LicenseData string `protobuf:"bytes,1,opt,name=licenseData,proto3" json:"licenseData,omitempty"` // contains filtered or unexported fields }
func (*LicensePayload) Descriptor
deprecated
func (*LicensePayload) Descriptor() ([]byte, []int)
Deprecated: Use LicensePayload.ProtoReflect.Descriptor instead.
func (*LicensePayload) GetLicenseData ¶
func (x *LicensePayload) GetLicenseData() string
func (*LicensePayload) ProtoMessage ¶
func (*LicensePayload) ProtoMessage()
func (*LicensePayload) ProtoReflect ¶
func (x *LicensePayload) ProtoReflect() protoreflect.Message
func (*LicensePayload) Reset ¶
func (x *LicensePayload) Reset()
func (*LicensePayload) String ¶
func (x *LicensePayload) String() string
type LicenseRequest ¶
type LicenseRequest struct {
// contains filtered or unexported fields
}
func (*LicenseRequest) Descriptor
deprecated
func (*LicenseRequest) Descriptor() ([]byte, []int)
Deprecated: Use LicenseRequest.ProtoReflect.Descriptor instead.
func (*LicenseRequest) ProtoMessage ¶
func (*LicenseRequest) ProtoMessage()
func (*LicenseRequest) ProtoReflect ¶
func (x *LicenseRequest) ProtoReflect() protoreflect.Message
func (*LicenseRequest) Reset ¶
func (x *LicenseRequest) Reset()
func (*LicenseRequest) String ¶
func (x *LicenseRequest) String() string
type LicenseResponse ¶
type LicenseResponse struct { Status Status `protobuf:"varint,1,opt,name=Status,proto3,enum=license.Status" json:"Status,omitempty"` ExpiryDate int64 `protobuf:"varint,2,opt,name=expiry_date,json=expiryDate,proto3" json:"expiry_date,omitempty"` Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` //message to the user Type LicenseType `protobuf:"varint,4,opt,name=type,proto3,enum=license.LicenseType" json:"type,omitempty"` Features map[string]string `` /* 157-byte string literal not displayed */ // contains filtered or unexported fields }
func (*LicenseResponse) Descriptor
deprecated
func (*LicenseResponse) Descriptor() ([]byte, []int)
Deprecated: Use LicenseResponse.ProtoReflect.Descriptor instead.
func (*LicenseResponse) GetExpiryDate ¶
func (x *LicenseResponse) GetExpiryDate() int64
func (*LicenseResponse) GetFeatures ¶
func (x *LicenseResponse) GetFeatures() map[string]string
func (*LicenseResponse) GetMessage ¶
func (x *LicenseResponse) GetMessage() string
func (*LicenseResponse) GetStatus ¶
func (x *LicenseResponse) GetStatus() Status
func (*LicenseResponse) GetType ¶
func (x *LicenseResponse) GetType() LicenseType
func (*LicenseResponse) ProtoMessage ¶
func (*LicenseResponse) ProtoMessage()
func (*LicenseResponse) ProtoReflect ¶
func (x *LicenseResponse) ProtoReflect() protoreflect.Message
func (*LicenseResponse) Reset ¶
func (x *LicenseResponse) Reset()
func (*LicenseResponse) String ¶
func (x *LicenseResponse) String() string
type LicenseServiceClient ¶
type LicenseServiceClient interface { GetLicense(ctx context.Context, in *LicenseRequest, opts ...grpc.CallOption) (*LicenseResponse, error) UploadLicense(ctx context.Context, in *LicensePayload, opts ...grpc.CallOption) (*LicenseResponse, error) }
LicenseServiceClient is the client API for LicenseService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewLicenseServiceClient ¶
func NewLicenseServiceClient(cc grpc.ClientConnInterface) LicenseServiceClient
type LicenseServiceServer ¶
type LicenseServiceServer interface { GetLicense(context.Context, *LicenseRequest) (*LicenseResponse, error) UploadLicense(context.Context, *LicensePayload) (*LicenseResponse, error) }
LicenseServiceServer is the server API for LicenseService service.
type LicenseType ¶
type LicenseType int32
const ( LicenseType_trial LicenseType = 0 LicenseType_pro LicenseType = 1 LicenseType_ami LicenseType = 2 )
func (LicenseType) Descriptor ¶
func (LicenseType) Descriptor() protoreflect.EnumDescriptor
func (LicenseType) Enum ¶
func (x LicenseType) Enum() *LicenseType
func (LicenseType) EnumDescriptor
deprecated
func (LicenseType) EnumDescriptor() ([]byte, []int)
Deprecated: Use LicenseType.Descriptor instead.
func (LicenseType) Number ¶
func (x LicenseType) Number() protoreflect.EnumNumber
func (LicenseType) String ¶
func (x LicenseType) String() string
func (LicenseType) Type ¶
func (LicenseType) Type() protoreflect.EnumType
type Status ¶
type Status int32
func (Status) Descriptor ¶
func (Status) Descriptor() protoreflect.EnumDescriptor
func (Status) EnumDescriptor
deprecated
func (Status) Number ¶
func (x Status) Number() protoreflect.EnumNumber
func (Status) Type ¶
func (Status) Type() protoreflect.EnumType
type UnimplementedLicenseServiceServer ¶
type UnimplementedLicenseServiceServer struct { }
UnimplementedLicenseServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedLicenseServiceServer) GetLicense ¶
func (*UnimplementedLicenseServiceServer) GetLicense(context.Context, *LicenseRequest) (*LicenseResponse, error)
func (*UnimplementedLicenseServiceServer) UploadLicense ¶
func (*UnimplementedLicenseServiceServer) UploadLicense(context.Context, *LicensePayload) (*LicenseResponse, error)