permits

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInternal = errors.New("internal failure")
View Source
var ErrUnavailable = errors.New("unavailable")
View Source
var File_api_grpc_permits_service_proto protoreflect.FileDescriptor

Functions

func RegisterServiceServer added in v0.0.2

func RegisterServiceServer(s *grpc.Server, srv ServiceServer)

Types

type GetUsageRequest added in v0.0.2

type GetUsageRequest struct {
	Subj subject.Subject `protobuf:"varint,1,opt,name=subj,proto3,enum=awakari.api.subject.Subject" json:"subj,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUsageRequest) Descriptor deprecated added in v0.0.2

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

Deprecated: Use GetUsageRequest.ProtoReflect.Descriptor instead.

func (*GetUsageRequest) GetSubj added in v0.0.2

func (x *GetUsageRequest) GetSubj() subject.Subject

func (*GetUsageRequest) ProtoMessage added in v0.0.2

func (*GetUsageRequest) ProtoMessage()

func (*GetUsageRequest) ProtoReflect added in v0.0.2

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

func (*GetUsageRequest) Reset added in v0.0.2

func (x *GetUsageRequest) Reset()

func (*GetUsageRequest) String added in v0.0.2

func (x *GetUsageRequest) String() string

type GetUsageResponse added in v0.0.2

type GetUsageResponse struct {
	Count      int64                  `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
	CountTotal int64                  `protobuf:"varint,2,opt,name=countTotal,proto3" json:"countTotal,omitempty"`
	Since      *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=since,proto3" json:"since,omitempty"`
	// contains filtered or unexported fields
}

func (*GetUsageResponse) Descriptor deprecated added in v0.0.2

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

Deprecated: Use GetUsageResponse.ProtoReflect.Descriptor instead.

func (*GetUsageResponse) GetCount added in v0.0.2

func (x *GetUsageResponse) GetCount() int64

func (*GetUsageResponse) GetCountTotal added in v0.0.2

func (x *GetUsageResponse) GetCountTotal() int64

func (*GetUsageResponse) GetSince added in v0.0.2

func (x *GetUsageResponse) GetSince() *timestamppb.Timestamp

func (*GetUsageResponse) ProtoMessage added in v0.0.2

func (*GetUsageResponse) ProtoMessage()

func (*GetUsageResponse) ProtoReflect added in v0.0.2

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

func (*GetUsageResponse) Reset added in v0.0.2

func (x *GetUsageResponse) Reset()

func (*GetUsageResponse) String added in v0.0.2

func (x *GetUsageResponse) String() string

type Service

type Service interface {

	// GetUsage returns the current group/user spent counts for the specified subject.
	// A client should specify the empty user id to get the group-level value.
	GetUsage(ctx context.Context, userId string, subj usage.Subject) (u usage.Usage, err error)
}

func NewService

func NewService(client ServiceClient) Service

func NewServiceMock

func NewServiceMock() Service

type ServiceClient added in v0.0.2

type ServiceClient interface {
	GetUsage(ctx context.Context, in *GetUsageRequest, opts ...grpc.CallOption) (*GetUsageResponse, error)
}

ServiceClient is the client API for Service service.

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

func NewServiceClient added in v0.0.2

func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient

type ServiceServer added in v0.0.2

type ServiceServer interface {
	GetUsage(context.Context, *GetUsageRequest) (*GetUsageResponse, error)
}

ServiceServer is the server API for Service service.

type UnimplementedServiceServer added in v0.0.2

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedServiceServer) GetUsage added in v0.0.2

Jump to

Keyboard shortcuts

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