Documentation ¶
Overview ¶
Package _go is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterPaymentServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterPaymentServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PaymentServiceClient) error
- func RegisterPaymentServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterPaymentServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PaymentServiceServer) error
- func RegisterPaymentServiceServer(s grpc.ServiceRegistrar, srv PaymentServiceServer)
- type CreateOrUpdateUserRequest
- func (*CreateOrUpdateUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateOrUpdateUserRequest) GetEmail() string
- func (x *CreateOrUpdateUserRequest) GetId() string
- func (x *CreateOrUpdateUserRequest) GetImage() string
- func (x *CreateOrUpdateUserRequest) GetName() string
- func (*CreateOrUpdateUserRequest) ProtoMessage()
- func (x *CreateOrUpdateUserRequest) ProtoReflect() protoreflect.Message
- func (x *CreateOrUpdateUserRequest) Reset()
- func (x *CreateOrUpdateUserRequest) String() string
- func (m *CreateOrUpdateUserRequest) Validate() error
- func (m *CreateOrUpdateUserRequest) ValidateAll() error
- type CreateOrUpdateUserRequestMultiError
- type CreateOrUpdateUserRequestValidationError
- func (e CreateOrUpdateUserRequestValidationError) Cause() error
- func (e CreateOrUpdateUserRequestValidationError) Error() string
- func (e CreateOrUpdateUserRequestValidationError) ErrorName() string
- func (e CreateOrUpdateUserRequestValidationError) Field() string
- func (e CreateOrUpdateUserRequestValidationError) Key() bool
- func (e CreateOrUpdateUserRequestValidationError) Reason() string
- type PaymentServiceClient
- type PaymentServiceServer
- type SeatRequest
- func (*SeatRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SeatRequest) GetOwnerId() string
- func (x *SeatRequest) GetProductId() string
- func (x *SeatRequest) GetRecipientEmail() string
- func (*SeatRequest) ProtoMessage()
- func (x *SeatRequest) ProtoReflect() protoreflect.Message
- func (x *SeatRequest) Reset()
- func (x *SeatRequest) String() string
- func (m *SeatRequest) Validate() error
- func (m *SeatRequest) ValidateAll() error
- type SeatRequestMultiError
- type SeatRequestValidationError
- func (e SeatRequestValidationError) Cause() error
- func (e SeatRequestValidationError) Error() string
- func (e SeatRequestValidationError) ErrorName() string
- func (e SeatRequestValidationError) Field() string
- func (e SeatRequestValidationError) Key() bool
- func (e SeatRequestValidationError) Reason() string
- type Subscription
- func (*Subscription) Descriptor() ([]byte, []int)deprecated
- func (x *Subscription) GetExpiresIn() *timestamppb.Timestamp
- func (x *Subscription) GetId() string
- func (x *Subscription) GetOwnerEmail() string
- func (x *Subscription) GetProvider() SubscriptionProvider
- func (x *Subscription) GetPurchasedAt() *timestamppb.Timestamp
- func (x *Subscription) GetRecipients() []string
- func (x *Subscription) GetSeats() int32
- func (x *Subscription) GetToken() string
- func (x *Subscription) GetType() SubscriptionType
- func (*Subscription) ProtoMessage()
- func (x *Subscription) ProtoReflect() protoreflect.Message
- func (x *Subscription) Reset()
- func (x *Subscription) String() string
- func (m *Subscription) Validate() error
- func (m *Subscription) ValidateAll() error
- type SubscriptionMultiError
- type SubscriptionProvider
- func (SubscriptionProvider) Descriptor() protoreflect.EnumDescriptor
- func (x SubscriptionProvider) Enum() *SubscriptionProvider
- func (SubscriptionProvider) EnumDescriptor() ([]byte, []int)deprecated
- func (x SubscriptionProvider) Number() protoreflect.EnumNumber
- func (x SubscriptionProvider) String() string
- func (SubscriptionProvider) Type() protoreflect.EnumType
- type SubscriptionRequest
- func (*SubscriptionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SubscriptionRequest) GetAppId() string
- func (x *SubscriptionRequest) GetUserId() string
- func (*SubscriptionRequest) ProtoMessage()
- func (x *SubscriptionRequest) ProtoReflect() protoreflect.Message
- func (x *SubscriptionRequest) Reset()
- func (x *SubscriptionRequest) String() string
- func (m *SubscriptionRequest) Validate() error
- func (m *SubscriptionRequest) ValidateAll() error
- type SubscriptionRequestMultiError
- type SubscriptionRequestValidationError
- func (e SubscriptionRequestValidationError) Cause() error
- func (e SubscriptionRequestValidationError) Error() string
- func (e SubscriptionRequestValidationError) ErrorName() string
- func (e SubscriptionRequestValidationError) Field() string
- func (e SubscriptionRequestValidationError) Key() bool
- func (e SubscriptionRequestValidationError) Reason() string
- type SubscriptionResponse
- func (*SubscriptionResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SubscriptionResponse) GetSubscription() *Subscription
- func (*SubscriptionResponse) ProtoMessage()
- func (x *SubscriptionResponse) ProtoReflect() protoreflect.Message
- func (x *SubscriptionResponse) Reset()
- func (x *SubscriptionResponse) String() string
- func (m *SubscriptionResponse) Validate() error
- func (m *SubscriptionResponse) ValidateAll() error
- type SubscriptionResponseMultiError
- type SubscriptionResponseValidationError
- func (e SubscriptionResponseValidationError) Cause() error
- func (e SubscriptionResponseValidationError) Error() string
- func (e SubscriptionResponseValidationError) ErrorName() string
- func (e SubscriptionResponseValidationError) Field() string
- func (e SubscriptionResponseValidationError) Key() bool
- func (e SubscriptionResponseValidationError) Reason() string
- type SubscriptionType
- func (SubscriptionType) Descriptor() protoreflect.EnumDescriptor
- func (x SubscriptionType) Enum() *SubscriptionType
- func (SubscriptionType) EnumDescriptor() ([]byte, []int)deprecated
- func (x SubscriptionType) Number() protoreflect.EnumNumber
- func (x SubscriptionType) String() string
- func (SubscriptionType) Type() protoreflect.EnumType
- type SubscriptionValidationError
- func (e SubscriptionValidationError) Cause() error
- func (e SubscriptionValidationError) Error() string
- func (e SubscriptionValidationError) ErrorName() string
- func (e SubscriptionValidationError) Field() string
- func (e SubscriptionValidationError) Key() bool
- func (e SubscriptionValidationError) Reason() string
- type UnimplementedPaymentServiceServer
- func (UnimplementedPaymentServiceServer) AddSeat(context.Context, *SeatRequest) (*wrapperspb.BoolValue, error)
- func (UnimplementedPaymentServiceServer) CreateOrUpdateUser(context.Context, *CreateOrUpdateUserRequest) (*UserResponse, error)
- func (UnimplementedPaymentServiceServer) GetSubscription(context.Context, *SubscriptionRequest) (*SubscriptionResponse, error)
- func (UnimplementedPaymentServiceServer) GetUser(context.Context, *UserRequest) (*UserResponse, error)
- func (UnimplementedPaymentServiceServer) RemoveSeat(context.Context, *SeatRequest) (*wrapperspb.BoolValue, error)
- type UnsafePaymentServiceServer
- type User
- func (*User) Descriptor() ([]byte, []int)deprecated
- func (x *User) GetEmail() string
- func (x *User) GetId() string
- func (x *User) GetImage() string
- func (x *User) GetName() string
- func (*User) ProtoMessage()
- func (x *User) ProtoReflect() protoreflect.Message
- func (x *User) Reset()
- func (x *User) String() string
- func (m *User) Validate() error
- func (m *User) ValidateAll() error
- type UserMultiError
- type UserRequest
- func (*UserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UserRequest) GetUserId() string
- func (*UserRequest) ProtoMessage()
- func (x *UserRequest) ProtoReflect() protoreflect.Message
- func (x *UserRequest) Reset()
- func (x *UserRequest) String() string
- func (m *UserRequest) Validate() error
- func (m *UserRequest) ValidateAll() error
- type UserRequestMultiError
- type UserRequestValidationError
- func (e UserRequestValidationError) Cause() error
- func (e UserRequestValidationError) Error() string
- func (e UserRequestValidationError) ErrorName() string
- func (e UserRequestValidationError) Field() string
- func (e UserRequestValidationError) Key() bool
- func (e UserRequestValidationError) Reason() string
- type UserResponse
- func (*UserResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UserResponse) GetUser() *User
- func (*UserResponse) ProtoMessage()
- func (x *UserResponse) ProtoReflect() protoreflect.Message
- func (x *UserResponse) Reset()
- func (x *UserResponse) String() string
- func (m *UserResponse) Validate() error
- func (m *UserResponse) ValidateAll() error
- type UserResponseMultiError
- type UserResponseValidationError
- func (e UserResponseValidationError) Cause() error
- func (e UserResponseValidationError) Error() string
- func (e UserResponseValidationError) ErrorName() string
- func (e UserResponseValidationError) Field() string
- func (e UserResponseValidationError) Key() bool
- func (e UserResponseValidationError) Reason() string
- type UserValidationError
Constants ¶
const ( PaymentService_GetUser_FullMethodName = "/core.pay.v1.PaymentService/GetUser" PaymentService_GetSubscription_FullMethodName = "/core.pay.v1.PaymentService/GetSubscription" PaymentService_CreateOrUpdateUser_FullMethodName = "/core.pay.v1.PaymentService/CreateOrUpdateUser" PaymentService_AddSeat_FullMethodName = "/core.pay.v1.PaymentService/AddSeat" PaymentService_RemoveSeat_FullMethodName = "/core.pay.v1.PaymentService/RemoveSeat" )
Variables ¶
var ( SubscriptionType_name = map[int32]string{ 0: "SUBSCRIPTION_TYPE_UNSPECIFIED", 1: "SUBSCRIPTION_TYPE_TRIAL", 2: "SUBSCRIPTION_TYPE_PREMIUM", 3: "SUBSCRIPTION_TYPE_MANUAL_PREMIUM", } SubscriptionType_value = map[string]int32{ "SUBSCRIPTION_TYPE_UNSPECIFIED": 0, "SUBSCRIPTION_TYPE_TRIAL": 1, "SUBSCRIPTION_TYPE_PREMIUM": 2, "SUBSCRIPTION_TYPE_MANUAL_PREMIUM": 3, } )
Enum value maps for SubscriptionType.
var ( SubscriptionProvider_name = map[int32]string{ 0: "SUBSCRIPTION_PROVIDER_UNSPECIFIED", 1: "SUBSCRIPTION_PROVIDER_APPLE", 2: "SUBSCRIPTION_PROVIDER_GOOGLE", 3: "SUBSCRIPTION_PROVIDER_STRIPE", } SubscriptionProvider_value = map[string]int32{ "SUBSCRIPTION_PROVIDER_UNSPECIFIED": 0, "SUBSCRIPTION_PROVIDER_APPLE": 1, "SUBSCRIPTION_PROVIDER_GOOGLE": 2, "SUBSCRIPTION_PROVIDER_STRIPE": 3, } )
Enum value maps for SubscriptionProvider.
var File_api_proto_v1_index_proto protoreflect.FileDescriptor
var PaymentService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "core.pay.v1.PaymentService", HandlerType: (*PaymentServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetUser", Handler: _PaymentService_GetUser_Handler, }, { MethodName: "GetSubscription", Handler: _PaymentService_GetSubscription_Handler, }, { MethodName: "CreateOrUpdateUser", Handler: _PaymentService_CreateOrUpdateUser_Handler, }, { MethodName: "AddSeat", Handler: _PaymentService_AddSeat_Handler, }, { MethodName: "RemoveSeat", Handler: _PaymentService_RemoveSeat_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/proto/v1/index.proto", }
PaymentService_ServiceDesc is the grpc.ServiceDesc for PaymentService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPaymentServiceHandler ¶
func RegisterPaymentServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterPaymentServiceHandler registers the http handlers for service PaymentService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterPaymentServiceHandlerClient ¶
func RegisterPaymentServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PaymentServiceClient) error
RegisterPaymentServiceHandlerClient registers the http handlers for service PaymentService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PaymentServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PaymentServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "PaymentServiceClient" to call the correct interceptors.
func RegisterPaymentServiceHandlerFromEndpoint ¶
func RegisterPaymentServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterPaymentServiceHandlerFromEndpoint is same as RegisterPaymentServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterPaymentServiceHandlerServer ¶
func RegisterPaymentServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PaymentServiceServer) error
RegisterPaymentServiceHandlerServer registers the http handlers for service PaymentService to "mux". UnaryRPC :call PaymentServiceServer 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 RegisterPaymentServiceHandlerFromEndpoint instead.
func RegisterPaymentServiceServer ¶
func RegisterPaymentServiceServer(s grpc.ServiceRegistrar, srv PaymentServiceServer)
Types ¶
type CreateOrUpdateUserRequest ¶
type CreateOrUpdateUserRequest struct { // id is the unique identifier of the user. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // email is the email of the user. Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` // name is the name of the user. Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // image is the image URL of the user. Image *string `protobuf:"bytes,4,opt,name=image,proto3,oneof" json:"image,omitempty"` // contains filtered or unexported fields }
CreateOrUpdateUserRequest
CreateOrUpdateUserRequest represents a request to create or update a user.
func (*CreateOrUpdateUserRequest) Descriptor
deprecated
func (*CreateOrUpdateUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateOrUpdateUserRequest.ProtoReflect.Descriptor instead.
func (*CreateOrUpdateUserRequest) GetEmail ¶
func (x *CreateOrUpdateUserRequest) GetEmail() string
func (*CreateOrUpdateUserRequest) GetId ¶
func (x *CreateOrUpdateUserRequest) GetId() string
func (*CreateOrUpdateUserRequest) GetImage ¶
func (x *CreateOrUpdateUserRequest) GetImage() string
func (*CreateOrUpdateUserRequest) GetName ¶
func (x *CreateOrUpdateUserRequest) GetName() string
func (*CreateOrUpdateUserRequest) ProtoMessage ¶
func (*CreateOrUpdateUserRequest) ProtoMessage()
func (*CreateOrUpdateUserRequest) ProtoReflect ¶
func (x *CreateOrUpdateUserRequest) ProtoReflect() protoreflect.Message
func (*CreateOrUpdateUserRequest) Reset ¶
func (x *CreateOrUpdateUserRequest) Reset()
func (*CreateOrUpdateUserRequest) String ¶
func (x *CreateOrUpdateUserRequest) String() string
func (*CreateOrUpdateUserRequest) Validate ¶
func (m *CreateOrUpdateUserRequest) Validate() error
Validate checks the field values on CreateOrUpdateUserRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*CreateOrUpdateUserRequest) ValidateAll ¶
func (m *CreateOrUpdateUserRequest) ValidateAll() error
ValidateAll checks the field values on CreateOrUpdateUserRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in CreateOrUpdateUserRequestMultiError, or nil if none found.
type CreateOrUpdateUserRequestMultiError ¶
type CreateOrUpdateUserRequestMultiError []error
CreateOrUpdateUserRequestMultiError is an error wrapping multiple validation errors returned by CreateOrUpdateUserRequest.ValidateAll() if the designated constraints aren't met.
func (CreateOrUpdateUserRequestMultiError) AllErrors ¶
func (m CreateOrUpdateUserRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CreateOrUpdateUserRequestMultiError) Error ¶
func (m CreateOrUpdateUserRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CreateOrUpdateUserRequestValidationError ¶
type CreateOrUpdateUserRequestValidationError struct {
// contains filtered or unexported fields
}
CreateOrUpdateUserRequestValidationError is the validation error returned by CreateOrUpdateUserRequest.Validate if the designated constraints aren't met.
func (CreateOrUpdateUserRequestValidationError) Cause ¶
func (e CreateOrUpdateUserRequestValidationError) Cause() error
Cause function returns cause value.
func (CreateOrUpdateUserRequestValidationError) Error ¶
func (e CreateOrUpdateUserRequestValidationError) Error() string
Error satisfies the builtin error interface
func (CreateOrUpdateUserRequestValidationError) ErrorName ¶
func (e CreateOrUpdateUserRequestValidationError) ErrorName() string
ErrorName returns error name.
func (CreateOrUpdateUserRequestValidationError) Field ¶
func (e CreateOrUpdateUserRequestValidationError) Field() string
Field function returns field value.
func (CreateOrUpdateUserRequestValidationError) Key ¶
func (e CreateOrUpdateUserRequestValidationError) Key() bool
Key function returns key value.
func (CreateOrUpdateUserRequestValidationError) Reason ¶
func (e CreateOrUpdateUserRequestValidationError) Reason() string
Reason function returns reason value.
type PaymentServiceClient ¶
type PaymentServiceClient interface { // GetUser // // GetUser returns the user with the given id. GetUser(ctx context.Context, in *UserRequest, opts ...grpc.CallOption) (*UserResponse, error) // GetSubscription // // GetSubscription returns the subscription with the given id. GetSubscription(ctx context.Context, in *SubscriptionRequest, opts ...grpc.CallOption) (*SubscriptionResponse, error) // CreateOrUpdateUser // // CreateOrUpdateUser creates or updates a user. CreateOrUpdateUser(ctx context.Context, in *CreateOrUpdateUserRequest, opts ...grpc.CallOption) (*UserResponse, error) // AddSeat // // AddSeat adds a seat to a subscription. AddSeat(ctx context.Context, in *SeatRequest, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) // RemoveSeat // // RemoveSeat removes a seat from a subscription. RemoveSeat(ctx context.Context, in *SeatRequest, opts ...grpc.CallOption) (*wrapperspb.BoolValue, error) }
PaymentServiceClient is the client API for PaymentService 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.
func NewPaymentServiceClient ¶
func NewPaymentServiceClient(cc grpc.ClientConnInterface) PaymentServiceClient
type PaymentServiceServer ¶
type PaymentServiceServer interface { // GetUser // // GetUser returns the user with the given id. GetUser(context.Context, *UserRequest) (*UserResponse, error) // GetSubscription // // GetSubscription returns the subscription with the given id. GetSubscription(context.Context, *SubscriptionRequest) (*SubscriptionResponse, error) // CreateOrUpdateUser // // CreateOrUpdateUser creates or updates a user. CreateOrUpdateUser(context.Context, *CreateOrUpdateUserRequest) (*UserResponse, error) // AddSeat // // AddSeat adds a seat to a subscription. AddSeat(context.Context, *SeatRequest) (*wrapperspb.BoolValue, error) // RemoveSeat // // RemoveSeat removes a seat from a subscription. RemoveSeat(context.Context, *SeatRequest) (*wrapperspb.BoolValue, error) // contains filtered or unexported methods }
PaymentServiceServer is the server API for PaymentService service. All implementations must embed UnimplementedPaymentServiceServer for forward compatibility
type SeatRequest ¶
type SeatRequest struct { // product_id is the unique identifier of the product. ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"` // owner_id is the unique identifier of the owner of the subscription. OwnerId string `protobuf:"bytes,2,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` // recipient_email is the email of the recipient of the subscription. RecipientEmail string `protobuf:"bytes,3,opt,name=recipient_email,json=recipientEmail,proto3" json:"recipient_email,omitempty"` // contains filtered or unexported fields }
SeatRequest
SeatRequest represents a request to add or remove a seat to a subscription.
func (*SeatRequest) Descriptor
deprecated
func (*SeatRequest) Descriptor() ([]byte, []int)
Deprecated: Use SeatRequest.ProtoReflect.Descriptor instead.
func (*SeatRequest) GetOwnerId ¶
func (x *SeatRequest) GetOwnerId() string
func (*SeatRequest) GetProductId ¶
func (x *SeatRequest) GetProductId() string
func (*SeatRequest) GetRecipientEmail ¶
func (x *SeatRequest) GetRecipientEmail() string
func (*SeatRequest) ProtoMessage ¶
func (*SeatRequest) ProtoMessage()
func (*SeatRequest) ProtoReflect ¶
func (x *SeatRequest) ProtoReflect() protoreflect.Message
func (*SeatRequest) Reset ¶
func (x *SeatRequest) Reset()
func (*SeatRequest) String ¶
func (x *SeatRequest) String() string
func (*SeatRequest) Validate ¶
func (m *SeatRequest) Validate() error
Validate checks the field values on SeatRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*SeatRequest) ValidateAll ¶
func (m *SeatRequest) ValidateAll() error
ValidateAll checks the field values on SeatRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in SeatRequestMultiError, or nil if none found.
type SeatRequestMultiError ¶
type SeatRequestMultiError []error
SeatRequestMultiError is an error wrapping multiple validation errors returned by SeatRequest.ValidateAll() if the designated constraints aren't met.
func (SeatRequestMultiError) AllErrors ¶
func (m SeatRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (SeatRequestMultiError) Error ¶
func (m SeatRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type SeatRequestValidationError ¶
type SeatRequestValidationError struct {
// contains filtered or unexported fields
}
SeatRequestValidationError is the validation error returned by SeatRequest.Validate if the designated constraints aren't met.
func (SeatRequestValidationError) Cause ¶
func (e SeatRequestValidationError) Cause() error
Cause function returns cause value.
func (SeatRequestValidationError) Error ¶
func (e SeatRequestValidationError) Error() string
Error satisfies the builtin error interface
func (SeatRequestValidationError) ErrorName ¶
func (e SeatRequestValidationError) ErrorName() string
ErrorName returns error name.
func (SeatRequestValidationError) Field ¶
func (e SeatRequestValidationError) Field() string
Field function returns field value.
func (SeatRequestValidationError) Key ¶
func (e SeatRequestValidationError) Key() bool
Key function returns key value.
func (SeatRequestValidationError) Reason ¶
func (e SeatRequestValidationError) Reason() string
Reason function returns reason value.
type Subscription ¶
type Subscription struct { // id is the unique identifier of the subscription. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // token is the token of the subscription. Token string `protobuf:"bytes,2,opt,name=token,proto3" json:"token,omitempty"` // type is the type of the subscription. Type SubscriptionType `protobuf:"varint,3,opt,name=type,proto3,enum=core.pay.v1.SubscriptionType" json:"type,omitempty"` // provider is the provider of the subscription. Provider SubscriptionProvider `protobuf:"varint,4,opt,name=provider,proto3,enum=core.pay.v1.SubscriptionProvider" json:"provider,omitempty"` // purchased_at is the time when the subscription was purchased. PurchasedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=purchased_at,json=purchasedAt,proto3" json:"purchased_at,omitempty"` // expires_in is the time when the subscription expires. ExpiresIn *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=expires_in,json=expiresIn,proto3" json:"expires_in,omitempty"` // seats is the number of seats that the subscription has. Seats int32 `protobuf:"varint,7,opt,name=seats,proto3" json:"seats,omitempty"` // owner_email is the email of the owner of the subscription (who purchased it). OwnerEmail *string `protobuf:"bytes,8,opt,name=owner_email,json=ownerEmail,proto3,oneof" json:"owner_email,omitempty"` // recipients is the list of emails of the recipients of the subscription. Recipients []string `protobuf:"bytes,9,rep,name=recipients,proto3" json:"recipients,omitempty"` // contains filtered or unexported fields }
Subscription
Subscription represents a subscription that a user has purchased.
func (*Subscription) Descriptor
deprecated
func (*Subscription) Descriptor() ([]byte, []int)
Deprecated: Use Subscription.ProtoReflect.Descriptor instead.
func (*Subscription) GetExpiresIn ¶
func (x *Subscription) GetExpiresIn() *timestamppb.Timestamp
func (*Subscription) GetId ¶
func (x *Subscription) GetId() string
func (*Subscription) GetOwnerEmail ¶
func (x *Subscription) GetOwnerEmail() string
func (*Subscription) GetProvider ¶
func (x *Subscription) GetProvider() SubscriptionProvider
func (*Subscription) GetPurchasedAt ¶
func (x *Subscription) GetPurchasedAt() *timestamppb.Timestamp
func (*Subscription) GetRecipients ¶
func (x *Subscription) GetRecipients() []string
func (*Subscription) GetSeats ¶
func (x *Subscription) GetSeats() int32
func (*Subscription) GetToken ¶
func (x *Subscription) GetToken() string
func (*Subscription) GetType ¶
func (x *Subscription) GetType() SubscriptionType
func (*Subscription) ProtoMessage ¶
func (*Subscription) ProtoMessage()
func (*Subscription) ProtoReflect ¶
func (x *Subscription) ProtoReflect() protoreflect.Message
func (*Subscription) Reset ¶
func (x *Subscription) Reset()
func (*Subscription) String ¶
func (x *Subscription) String() string
func (*Subscription) Validate ¶
func (m *Subscription) Validate() error
Validate checks the field values on Subscription with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Subscription) ValidateAll ¶
func (m *Subscription) ValidateAll() error
ValidateAll checks the field values on Subscription with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in SubscriptionMultiError, or nil if none found.
type SubscriptionMultiError ¶
type SubscriptionMultiError []error
SubscriptionMultiError is an error wrapping multiple validation errors returned by Subscription.ValidateAll() if the designated constraints aren't met.
func (SubscriptionMultiError) AllErrors ¶
func (m SubscriptionMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (SubscriptionMultiError) Error ¶
func (m SubscriptionMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type SubscriptionProvider ¶
type SubscriptionProvider int32
SubscriptionProvider
SubscriptionProvider represents the provider of the subscription.
const ( SubscriptionProvider_SUBSCRIPTION_PROVIDER_UNSPECIFIED SubscriptionProvider = 0 // SUBSCRIPTION_PROVIDER_APPLE represents a subscription purchased through Apple. SubscriptionProvider_SUBSCRIPTION_PROVIDER_APPLE SubscriptionProvider = 1 // SUBSCRIPTION_PROVIDER_GOOGLE represents a subscription purchased through Google. SubscriptionProvider_SUBSCRIPTION_PROVIDER_GOOGLE SubscriptionProvider = 2 // SUBSCRIPTION_PROVIDER_STRIPE represents a subscription purchased through Stripe. SubscriptionProvider_SUBSCRIPTION_PROVIDER_STRIPE SubscriptionProvider = 3 )
func (SubscriptionProvider) Descriptor ¶
func (SubscriptionProvider) Descriptor() protoreflect.EnumDescriptor
func (SubscriptionProvider) Enum ¶
func (x SubscriptionProvider) Enum() *SubscriptionProvider
func (SubscriptionProvider) EnumDescriptor
deprecated
func (SubscriptionProvider) EnumDescriptor() ([]byte, []int)
Deprecated: Use SubscriptionProvider.Descriptor instead.
func (SubscriptionProvider) Number ¶
func (x SubscriptionProvider) Number() protoreflect.EnumNumber
func (SubscriptionProvider) String ¶
func (x SubscriptionProvider) String() string
func (SubscriptionProvider) Type ¶
func (SubscriptionProvider) Type() protoreflect.EnumType
type SubscriptionRequest ¶
type SubscriptionRequest struct { // user_id is the unique identifier of the user. UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // app_id is the unique identifier of the application. AppId string `protobuf:"bytes,2,opt,name=app_id,json=appId,proto3" json:"app_id,omitempty"` // contains filtered or unexported fields }
SubscriptionRequest
SubscriptionRequest represents a request to get a subscription.
func (*SubscriptionRequest) Descriptor
deprecated
func (*SubscriptionRequest) Descriptor() ([]byte, []int)
Deprecated: Use SubscriptionRequest.ProtoReflect.Descriptor instead.
func (*SubscriptionRequest) GetAppId ¶
func (x *SubscriptionRequest) GetAppId() string
func (*SubscriptionRequest) GetUserId ¶
func (x *SubscriptionRequest) GetUserId() string
func (*SubscriptionRequest) ProtoMessage ¶
func (*SubscriptionRequest) ProtoMessage()
func (*SubscriptionRequest) ProtoReflect ¶
func (x *SubscriptionRequest) ProtoReflect() protoreflect.Message
func (*SubscriptionRequest) Reset ¶
func (x *SubscriptionRequest) Reset()
func (*SubscriptionRequest) String ¶
func (x *SubscriptionRequest) String() string
func (*SubscriptionRequest) Validate ¶
func (m *SubscriptionRequest) Validate() error
Validate checks the field values on SubscriptionRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*SubscriptionRequest) ValidateAll ¶
func (m *SubscriptionRequest) ValidateAll() error
ValidateAll checks the field values on SubscriptionRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in SubscriptionRequestMultiError, or nil if none found.
type SubscriptionRequestMultiError ¶
type SubscriptionRequestMultiError []error
SubscriptionRequestMultiError is an error wrapping multiple validation errors returned by SubscriptionRequest.ValidateAll() if the designated constraints aren't met.
func (SubscriptionRequestMultiError) AllErrors ¶
func (m SubscriptionRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (SubscriptionRequestMultiError) Error ¶
func (m SubscriptionRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type SubscriptionRequestValidationError ¶
type SubscriptionRequestValidationError struct {
// contains filtered or unexported fields
}
SubscriptionRequestValidationError is the validation error returned by SubscriptionRequest.Validate if the designated constraints aren't met.
func (SubscriptionRequestValidationError) Cause ¶
func (e SubscriptionRequestValidationError) Cause() error
Cause function returns cause value.
func (SubscriptionRequestValidationError) Error ¶
func (e SubscriptionRequestValidationError) Error() string
Error satisfies the builtin error interface
func (SubscriptionRequestValidationError) ErrorName ¶
func (e SubscriptionRequestValidationError) ErrorName() string
ErrorName returns error name.
func (SubscriptionRequestValidationError) Field ¶
func (e SubscriptionRequestValidationError) Field() string
Field function returns field value.
func (SubscriptionRequestValidationError) Key ¶
func (e SubscriptionRequestValidationError) Key() bool
Key function returns key value.
func (SubscriptionRequestValidationError) Reason ¶
func (e SubscriptionRequestValidationError) Reason() string
Reason function returns reason value.
type SubscriptionResponse ¶
type SubscriptionResponse struct { // subscription is the subscription. Subscription *Subscription `protobuf:"bytes,1,opt,name=subscription,proto3,oneof" json:"subscription,omitempty"` // contains filtered or unexported fields }
SubscriptionResponse
SubscriptionResponse represents a response to get a subscription.
func (*SubscriptionResponse) Descriptor
deprecated
func (*SubscriptionResponse) Descriptor() ([]byte, []int)
Deprecated: Use SubscriptionResponse.ProtoReflect.Descriptor instead.
func (*SubscriptionResponse) GetSubscription ¶
func (x *SubscriptionResponse) GetSubscription() *Subscription
func (*SubscriptionResponse) ProtoMessage ¶
func (*SubscriptionResponse) ProtoMessage()
func (*SubscriptionResponse) ProtoReflect ¶
func (x *SubscriptionResponse) ProtoReflect() protoreflect.Message
func (*SubscriptionResponse) Reset ¶
func (x *SubscriptionResponse) Reset()
func (*SubscriptionResponse) String ¶
func (x *SubscriptionResponse) String() string
func (*SubscriptionResponse) Validate ¶
func (m *SubscriptionResponse) Validate() error
Validate checks the field values on SubscriptionResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*SubscriptionResponse) ValidateAll ¶
func (m *SubscriptionResponse) ValidateAll() error
ValidateAll checks the field values on SubscriptionResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in SubscriptionResponseMultiError, or nil if none found.
type SubscriptionResponseMultiError ¶
type SubscriptionResponseMultiError []error
SubscriptionResponseMultiError is an error wrapping multiple validation errors returned by SubscriptionResponse.ValidateAll() if the designated constraints aren't met.
func (SubscriptionResponseMultiError) AllErrors ¶
func (m SubscriptionResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (SubscriptionResponseMultiError) Error ¶
func (m SubscriptionResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type SubscriptionResponseValidationError ¶
type SubscriptionResponseValidationError struct {
// contains filtered or unexported fields
}
SubscriptionResponseValidationError is the validation error returned by SubscriptionResponse.Validate if the designated constraints aren't met.
func (SubscriptionResponseValidationError) Cause ¶
func (e SubscriptionResponseValidationError) Cause() error
Cause function returns cause value.
func (SubscriptionResponseValidationError) Error ¶
func (e SubscriptionResponseValidationError) Error() string
Error satisfies the builtin error interface
func (SubscriptionResponseValidationError) ErrorName ¶
func (e SubscriptionResponseValidationError) ErrorName() string
ErrorName returns error name.
func (SubscriptionResponseValidationError) Field ¶
func (e SubscriptionResponseValidationError) Field() string
Field function returns field value.
func (SubscriptionResponseValidationError) Key ¶
func (e SubscriptionResponseValidationError) Key() bool
Key function returns key value.
func (SubscriptionResponseValidationError) Reason ¶
func (e SubscriptionResponseValidationError) Reason() string
Reason function returns reason value.
type SubscriptionType ¶
type SubscriptionType int32
SubscriptionType
SubscriptionType represents the type of subscription that a user has purchased.
const ( SubscriptionType_SUBSCRIPTION_TYPE_UNSPECIFIED SubscriptionType = 0 // SUBSCRIPTION_TYPE_TRIAL represents a trial subscription. SubscriptionType_SUBSCRIPTION_TYPE_TRIAL SubscriptionType = 1 // SUBSCRIPTION_TYPE_TRIAL represents a premium subscription. SubscriptionType_SUBSCRIPTION_TYPE_PREMIUM SubscriptionType = 2 // SUBSCRIPTION_TYPE_PREMIUM represents a manual premium subscription. SubscriptionType_SUBSCRIPTION_TYPE_MANUAL_PREMIUM SubscriptionType = 3 )
func (SubscriptionType) Descriptor ¶
func (SubscriptionType) Descriptor() protoreflect.EnumDescriptor
func (SubscriptionType) Enum ¶
func (x SubscriptionType) Enum() *SubscriptionType
func (SubscriptionType) EnumDescriptor
deprecated
func (SubscriptionType) EnumDescriptor() ([]byte, []int)
Deprecated: Use SubscriptionType.Descriptor instead.
func (SubscriptionType) Number ¶
func (x SubscriptionType) Number() protoreflect.EnumNumber
func (SubscriptionType) String ¶
func (x SubscriptionType) String() string
func (SubscriptionType) Type ¶
func (SubscriptionType) Type() protoreflect.EnumType
type SubscriptionValidationError ¶
type SubscriptionValidationError struct {
// contains filtered or unexported fields
}
SubscriptionValidationError is the validation error returned by Subscription.Validate if the designated constraints aren't met.
func (SubscriptionValidationError) Cause ¶
func (e SubscriptionValidationError) Cause() error
Cause function returns cause value.
func (SubscriptionValidationError) Error ¶
func (e SubscriptionValidationError) Error() string
Error satisfies the builtin error interface
func (SubscriptionValidationError) ErrorName ¶
func (e SubscriptionValidationError) ErrorName() string
ErrorName returns error name.
func (SubscriptionValidationError) Field ¶
func (e SubscriptionValidationError) Field() string
Field function returns field value.
func (SubscriptionValidationError) Key ¶
func (e SubscriptionValidationError) Key() bool
Key function returns key value.
func (SubscriptionValidationError) Reason ¶
func (e SubscriptionValidationError) Reason() string
Reason function returns reason value.
type UnimplementedPaymentServiceServer ¶
type UnimplementedPaymentServiceServer struct { }
UnimplementedPaymentServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedPaymentServiceServer) AddSeat ¶
func (UnimplementedPaymentServiceServer) AddSeat(context.Context, *SeatRequest) (*wrapperspb.BoolValue, error)
func (UnimplementedPaymentServiceServer) CreateOrUpdateUser ¶
func (UnimplementedPaymentServiceServer) CreateOrUpdateUser(context.Context, *CreateOrUpdateUserRequest) (*UserResponse, error)
func (UnimplementedPaymentServiceServer) GetSubscription ¶
func (UnimplementedPaymentServiceServer) GetSubscription(context.Context, *SubscriptionRequest) (*SubscriptionResponse, error)
func (UnimplementedPaymentServiceServer) GetUser ¶
func (UnimplementedPaymentServiceServer) GetUser(context.Context, *UserRequest) (*UserResponse, error)
func (UnimplementedPaymentServiceServer) RemoveSeat ¶
func (UnimplementedPaymentServiceServer) RemoveSeat(context.Context, *SeatRequest) (*wrapperspb.BoolValue, error)
type UnsafePaymentServiceServer ¶
type UnsafePaymentServiceServer interface {
// contains filtered or unexported methods
}
UnsafePaymentServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PaymentServiceServer will result in compilation errors.
type User ¶
type User struct { // id is the unique identifier of the user. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // email is the email of the user. Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` // name is the name of the user. Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` // image is the image URL of the user. Image string `protobuf:"bytes,4,opt,name=image,proto3" json:"image,omitempty"` // contains filtered or unexported fields }
User
User represents a user of the application.
func (*User) Descriptor
deprecated
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message
func (*User) Validate ¶
Validate checks the field values on User with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*User) ValidateAll ¶
ValidateAll checks the field values on User with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UserMultiError, or nil if none found.
type UserMultiError ¶
type UserMultiError []error
UserMultiError is an error wrapping multiple validation errors returned by User.ValidateAll() if the designated constraints aren't met.
func (UserMultiError) AllErrors ¶
func (m UserMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (UserMultiError) Error ¶
func (m UserMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type UserRequest ¶
type UserRequest struct { // user_id is the unique identifier of the user. UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // contains filtered or unexported fields }
UserRequest
UserRequest represents a request to get a user.
func (*UserRequest) Descriptor
deprecated
func (*UserRequest) Descriptor() ([]byte, []int)
Deprecated: Use UserRequest.ProtoReflect.Descriptor instead.
func (*UserRequest) GetUserId ¶
func (x *UserRequest) GetUserId() string
func (*UserRequest) ProtoMessage ¶
func (*UserRequest) ProtoMessage()
func (*UserRequest) ProtoReflect ¶
func (x *UserRequest) ProtoReflect() protoreflect.Message
func (*UserRequest) Reset ¶
func (x *UserRequest) Reset()
func (*UserRequest) String ¶
func (x *UserRequest) String() string
func (*UserRequest) Validate ¶
func (m *UserRequest) Validate() error
Validate checks the field values on UserRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*UserRequest) ValidateAll ¶
func (m *UserRequest) ValidateAll() error
ValidateAll checks the field values on UserRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UserRequestMultiError, or nil if none found.
type UserRequestMultiError ¶
type UserRequestMultiError []error
UserRequestMultiError is an error wrapping multiple validation errors returned by UserRequest.ValidateAll() if the designated constraints aren't met.
func (UserRequestMultiError) AllErrors ¶
func (m UserRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (UserRequestMultiError) Error ¶
func (m UserRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type UserRequestValidationError ¶
type UserRequestValidationError struct {
// contains filtered or unexported fields
}
UserRequestValidationError is the validation error returned by UserRequest.Validate if the designated constraints aren't met.
func (UserRequestValidationError) Cause ¶
func (e UserRequestValidationError) Cause() error
Cause function returns cause value.
func (UserRequestValidationError) Error ¶
func (e UserRequestValidationError) Error() string
Error satisfies the builtin error interface
func (UserRequestValidationError) ErrorName ¶
func (e UserRequestValidationError) ErrorName() string
ErrorName returns error name.
func (UserRequestValidationError) Field ¶
func (e UserRequestValidationError) Field() string
Field function returns field value.
func (UserRequestValidationError) Key ¶
func (e UserRequestValidationError) Key() bool
Key function returns key value.
func (UserRequestValidationError) Reason ¶
func (e UserRequestValidationError) Reason() string
Reason function returns reason value.
type UserResponse ¶
type UserResponse struct { // user is the user. User *User `protobuf:"bytes,1,opt,name=user,proto3,oneof" json:"user,omitempty"` // contains filtered or unexported fields }
UserResponse
UserResponse represents a response to get a user.
func (*UserResponse) Descriptor
deprecated
func (*UserResponse) Descriptor() ([]byte, []int)
Deprecated: Use UserResponse.ProtoReflect.Descriptor instead.
func (*UserResponse) GetUser ¶
func (x *UserResponse) GetUser() *User
func (*UserResponse) ProtoMessage ¶
func (*UserResponse) ProtoMessage()
func (*UserResponse) ProtoReflect ¶
func (x *UserResponse) ProtoReflect() protoreflect.Message
func (*UserResponse) Reset ¶
func (x *UserResponse) Reset()
func (*UserResponse) String ¶
func (x *UserResponse) String() string
func (*UserResponse) Validate ¶
func (m *UserResponse) Validate() error
Validate checks the field values on UserResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*UserResponse) ValidateAll ¶
func (m *UserResponse) ValidateAll() error
ValidateAll checks the field values on UserResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UserResponseMultiError, or nil if none found.
type UserResponseMultiError ¶
type UserResponseMultiError []error
UserResponseMultiError is an error wrapping multiple validation errors returned by UserResponse.ValidateAll() if the designated constraints aren't met.
func (UserResponseMultiError) AllErrors ¶
func (m UserResponseMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (UserResponseMultiError) Error ¶
func (m UserResponseMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type UserResponseValidationError ¶
type UserResponseValidationError struct {
// contains filtered or unexported fields
}
UserResponseValidationError is the validation error returned by UserResponse.Validate if the designated constraints aren't met.
func (UserResponseValidationError) Cause ¶
func (e UserResponseValidationError) Cause() error
Cause function returns cause value.
func (UserResponseValidationError) Error ¶
func (e UserResponseValidationError) Error() string
Error satisfies the builtin error interface
func (UserResponseValidationError) ErrorName ¶
func (e UserResponseValidationError) ErrorName() string
ErrorName returns error name.
func (UserResponseValidationError) Field ¶
func (e UserResponseValidationError) Field() string
Field function returns field value.
func (UserResponseValidationError) Key ¶
func (e UserResponseValidationError) Key() bool
Key function returns key value.
func (UserResponseValidationError) Reason ¶
func (e UserResponseValidationError) Reason() string
Reason function returns reason value.
type UserValidationError ¶
type UserValidationError struct {
// contains filtered or unexported fields
}
UserValidationError is the validation error returned by User.Validate if the designated constraints aren't met.
func (UserValidationError) Cause ¶
func (e UserValidationError) Cause() error
Cause function returns cause value.
func (UserValidationError) Error ¶
func (e UserValidationError) Error() string
Error satisfies the builtin error interface
func (UserValidationError) ErrorName ¶
func (e UserValidationError) ErrorName() string
ErrorName returns error name.
func (UserValidationError) Field ¶
func (e UserValidationError) Field() string
Field function returns field value.
func (UserValidationError) Key ¶
func (e UserValidationError) Key() bool
Key function returns key value.
func (UserValidationError) Reason ¶
func (e UserValidationError) Reason() string
Reason function returns reason value.