licensesv1

package
v0.0.0-...-59c490d Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package licensesv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	LicenseService_List_FullMethodName     = "/licenses.v1.LicenseService/List"
	LicenseService_Purchase_FullMethodName = "/licenses.v1.LicenseService/Purchase"
	LicenseService_Cancel_FullMethodName   = "/licenses.v1.LicenseService/Cancel"
)

Variables

View Source
var File_licenses_v1_service_proto protoreflect.FileDescriptor
View Source
var LicenseService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "licenses.v1.LicenseService",
	HandlerType: (*LicenseServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _LicenseService_List_Handler,
		},
		{
			MethodName: "Purchase",
			Handler:    _LicenseService_Purchase_Handler,
		},
		{
			MethodName: "Cancel",
			Handler:    _LicenseService_Cancel_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "licenses/v1/service.proto",
}

LicenseService_ServiceDesc is the grpc.ServiceDesc for LicenseService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

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.ServiceRegistrar, srv LicenseServiceServer)

Types

type CancelRequest

type CancelRequest struct {
	LicenseId string `protobuf:"bytes,1,opt,name=license_id,json=licenseId,proto3" json:"license_id,omitempty"`
	// contains filtered or unexported fields
}

func (*CancelRequest) Descriptor deprecated

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

Deprecated: Use CancelRequest.ProtoReflect.Descriptor instead.

func (*CancelRequest) GetLicenseId

func (x *CancelRequest) GetLicenseId() string

func (*CancelRequest) ProtoMessage

func (*CancelRequest) ProtoMessage()

func (*CancelRequest) ProtoReflect

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

func (*CancelRequest) Reset

func (x *CancelRequest) Reset()

func (*CancelRequest) String

func (x *CancelRequest) String() string

type CancelResponse

type CancelResponse struct {
	// contains filtered or unexported fields
}

func (*CancelResponse) Descriptor deprecated

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

Deprecated: Use CancelResponse.ProtoReflect.Descriptor instead.

func (*CancelResponse) ProtoMessage

func (*CancelResponse) ProtoMessage()

func (*CancelResponse) ProtoReflect

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

func (*CancelResponse) Reset

func (x *CancelResponse) Reset()

func (*CancelResponse) String

func (x *CancelResponse) String() string

type License

type License struct {
	Id          string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	ProductId   string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
	PackageName string `protobuf:"bytes,3,opt,name=package_name,json=packageName,proto3" json:"package_name,omitempty"`
	// contains filtered or unexported fields
}

func (*License) Descriptor deprecated

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

Deprecated: Use License.ProtoReflect.Descriptor instead.

func (*License) GetId

func (x *License) GetId() string

func (*License) GetPackageName

func (x *License) GetPackageName() string

func (*License) GetProductId

func (x *License) GetProductId() string

func (*License) ProtoMessage

func (*License) ProtoMessage()

func (*License) ProtoReflect

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

func (*License) Reset

func (x *License) Reset()

func (*License) String

func (x *License) String() string

type LicenseServiceClient

type LicenseServiceClient interface {
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
	Purchase(ctx context.Context, in *PurchaseRequest, opts ...grpc.CallOption) (*PurchaseResponse, error)
	Cancel(ctx context.Context, in *CancelRequest, opts ...grpc.CallOption) (*CancelResponse, error)
}

LicenseServiceClient is the client API for LicenseService 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 LicenseServiceServer

type LicenseServiceServer interface {
	List(context.Context, *ListRequest) (*ListResponse, error)
	Purchase(context.Context, *PurchaseRequest) (*PurchaseResponse, error)
	Cancel(context.Context, *CancelRequest) (*CancelResponse, error)
	// contains filtered or unexported methods
}

LicenseServiceServer is the server API for LicenseService service. All implementations must embed UnimplementedLicenseServiceServer for forward compatibility

type ListRequest

type ListRequest struct {
	// contains filtered or unexported fields
}

func (*ListRequest) Descriptor deprecated

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

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect

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

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

type ListResponse

type ListResponse struct {
	Licenses []*License `protobuf:"bytes,1,rep,name=licenses,proto3" json:"licenses,omitempty"`
	// contains filtered or unexported fields
}

func (*ListResponse) Descriptor deprecated

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

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetLicenses

func (x *ListResponse) GetLicenses() []*License

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect

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

func (*ListResponse) Reset

func (x *ListResponse) Reset()

func (*ListResponse) String

func (x *ListResponse) String() string

type PurchaseRequest

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

func (*PurchaseRequest) Descriptor deprecated

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

Deprecated: Use PurchaseRequest.ProtoReflect.Descriptor instead.

func (*PurchaseRequest) GetLicense

func (x *PurchaseRequest) GetLicense() *License

func (*PurchaseRequest) ProtoMessage

func (*PurchaseRequest) ProtoMessage()

func (*PurchaseRequest) ProtoReflect

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

func (*PurchaseRequest) Reset

func (x *PurchaseRequest) Reset()

func (*PurchaseRequest) String

func (x *PurchaseRequest) String() string

type PurchaseResponse

type PurchaseResponse struct {
	// contains filtered or unexported fields
}

func (*PurchaseResponse) Descriptor deprecated

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

Deprecated: Use PurchaseResponse.ProtoReflect.Descriptor instead.

func (*PurchaseResponse) ProtoMessage

func (*PurchaseResponse) ProtoMessage()

func (*PurchaseResponse) ProtoReflect

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

func (*PurchaseResponse) Reset

func (x *PurchaseResponse) Reset()

func (*PurchaseResponse) String

func (x *PurchaseResponse) String() string

type UnimplementedLicenseServiceServer

type UnimplementedLicenseServiceServer struct {
}

UnimplementedLicenseServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedLicenseServiceServer) Cancel

func (UnimplementedLicenseServiceServer) List

func (UnimplementedLicenseServiceServer) Purchase

type UnsafeLicenseServiceServer

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

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

Jump to

Keyboard shortcuts

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