license

package
v0.0.0-...-28787c5 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package license is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
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.

View Source
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.

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) 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

type Status

type Status int32
const (
	Status_notFound      Status = 0
	Status_expired       Status = 1
	Status_aboutToExpire Status = 2
	Status_valid         Status = 3
)

func (Status) Descriptor

func (Status) Descriptor() protoreflect.EnumDescriptor

func (Status) Enum

func (x Status) Enum() *Status

func (Status) EnumDescriptor deprecated

func (Status) EnumDescriptor() ([]byte, []int)

Deprecated: Use Status.Descriptor instead.

func (Status) Number

func (x Status) Number() protoreflect.EnumNumber

func (Status) String

func (x Status) String() string

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) UploadLicense

Jump to

Keyboard shortcuts

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