Documentation ¶
Index ¶
- Variables
- func RegisterServiceServer(s *grpc.Server, srv ServiceServer)
- type GetRequest
- type GetResponse
- func (*GetResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetResponse) GetCount() int64
- func (x *GetResponse) GetExpires() *timestamppb.Timestamp
- func (x *GetResponse) GetUserId() string
- func (*GetResponse) ProtoMessage()
- func (x *GetResponse) ProtoReflect() protoreflect.Message
- func (x *GetResponse) Reset()
- func (x *GetResponse) String() string
- type Service
- type ServiceClient
- type ServiceServer
- type UnimplementedServiceServer
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInternal = errors.New("internal failure")
View Source
var ErrReached = errors.New("usage limit reached")
View Source
var File_api_grpc_limits_service_proto protoreflect.FileDescriptor
Functions ¶
func RegisterServiceServer ¶ added in v0.0.2
func RegisterServiceServer(s *grpc.Server, srv ServiceServer)
Types ¶
type GetRequest ¶ added in v0.0.2
type GetRequest 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 (*GetRequest) Descriptor
deprecated
added in
v0.0.2
func (*GetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) GetSubj ¶ added in v0.0.2
func (x *GetRequest) GetSubj() subject.Subject
func (*GetRequest) ProtoMessage ¶ added in v0.0.2
func (*GetRequest) ProtoMessage()
func (*GetRequest) ProtoReflect ¶ added in v0.0.2
func (x *GetRequest) ProtoReflect() protoreflect.Message
func (*GetRequest) Reset ¶ added in v0.0.2
func (x *GetRequest) Reset()
func (*GetRequest) String ¶ added in v0.0.2
func (x *GetRequest) String() string
type GetResponse ¶ added in v0.0.2
type GetResponse struct { UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` Expires *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=expires,proto3" json:"expires,omitempty"` // contains filtered or unexported fields }
func (*GetResponse) Descriptor
deprecated
added in
v0.0.2
func (*GetResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.
func (*GetResponse) GetCount ¶ added in v0.0.2
func (x *GetResponse) GetCount() int64
func (*GetResponse) GetExpires ¶ added in v1.0.5
func (x *GetResponse) GetExpires() *timestamppb.Timestamp
func (*GetResponse) GetUserId ¶ added in v0.0.2
func (x *GetResponse) GetUserId() string
func (*GetResponse) ProtoMessage ¶ added in v0.0.2
func (*GetResponse) ProtoMessage()
func (*GetResponse) ProtoReflect ¶ added in v0.0.2
func (x *GetResponse) ProtoReflect() protoreflect.Message
func (*GetResponse) Reset ¶ added in v0.0.2
func (x *GetResponse) Reset()
func (*GetResponse) String ¶ added in v0.0.2
func (x *GetResponse) String() string
type Service ¶
type Service interface {
Get(ctx context.Context, userId string, subj usage.Subject) (l usage.Limit, err error)
}
func NewService ¶
func NewService(client ServiceClient) Service
func NewServiceMock ¶
func NewServiceMock() Service
type ServiceClient ¶ added in v0.0.2
type ServiceClient interface {
Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, 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 NewClientConnPool ¶ added in v1.2.0
func NewClientConnPool(connPool *grpcpool.Pool) ServiceClient
func NewServiceClient ¶ added in v0.0.2
func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient
type ServiceServer ¶ added in v0.0.2
type ServiceServer interface {
Get(context.Context, *GetRequest) (*GetResponse, 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) Get ¶ added in v0.0.2
func (*UnimplementedServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error)
Click to show internal directories.
Click to hide internal directories.