_go

package
v0.0.0-...-419003e Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 32 Imported by: 0

Documentation

Overview

Package _go is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

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

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

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

View Source
var File_api_proto_v1_index_proto protoreflect.FileDescriptor
View Source
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 (*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

AllErrors returns a list of validation violation errors.

func (CreateOrUpdateUserRequestMultiError) Error

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

Cause function returns cause value.

func (CreateOrUpdateUserRequestValidationError) Error

Error satisfies the builtin error interface

func (CreateOrUpdateUserRequestValidationError) ErrorName

ErrorName returns error name.

func (CreateOrUpdateUserRequestValidationError) Field

Field function returns field value.

func (CreateOrUpdateUserRequestValidationError) Key

Key function returns key value.

func (CreateOrUpdateUserRequestValidationError) Reason

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.

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

Cause function returns cause value.

func (SeatRequestValidationError) Error

Error satisfies the builtin error interface

func (SeatRequestValidationError) ErrorName

func (e SeatRequestValidationError) ErrorName() string

ErrorName returns error name.

func (SeatRequestValidationError) Field

Field function returns field value.

func (SeatRequestValidationError) Key

Key function returns key value.

func (SeatRequestValidationError) Reason

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

func (SubscriptionProvider) EnumDescriptor deprecated

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

Deprecated: Use SubscriptionProvider.Descriptor instead.

func (SubscriptionProvider) Number

func (SubscriptionProvider) String

func (x SubscriptionProvider) String() string

func (SubscriptionProvider) Type

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

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

Cause function returns cause value.

func (SubscriptionRequestValidationError) Error

Error satisfies the builtin error interface

func (SubscriptionRequestValidationError) ErrorName

ErrorName returns error name.

func (SubscriptionRequestValidationError) Field

Field function returns field value.

func (SubscriptionRequestValidationError) Key

Key function returns key value.

func (SubscriptionRequestValidationError) Reason

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

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

Cause function returns cause value.

func (SubscriptionResponseValidationError) Error

Error satisfies the builtin error interface

func (SubscriptionResponseValidationError) ErrorName

ErrorName returns error name.

func (SubscriptionResponseValidationError) Field

Field function returns field value.

func (SubscriptionResponseValidationError) Key

Key function returns key value.

func (SubscriptionResponseValidationError) Reason

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

func (SubscriptionType) EnumDescriptor deprecated

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

Deprecated: Use SubscriptionType.Descriptor instead.

func (SubscriptionType) Number

func (SubscriptionType) String

func (x SubscriptionType) String() string

func (SubscriptionType) Type

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

Cause function returns cause value.

func (SubscriptionValidationError) Error

Error satisfies the builtin error interface

func (SubscriptionValidationError) ErrorName

func (e SubscriptionValidationError) ErrorName() string

ErrorName returns error name.

func (SubscriptionValidationError) Field

Field function returns field value.

func (SubscriptionValidationError) Key

Key function returns key value.

func (SubscriptionValidationError) Reason

Reason function returns reason value.

type UnimplementedPaymentServiceServer

type UnimplementedPaymentServiceServer struct {
}

UnimplementedPaymentServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedPaymentServiceServer) AddSeat

func (UnimplementedPaymentServiceServer) CreateOrUpdateUser

func (UnimplementedPaymentServiceServer) GetSubscription

func (UnimplementedPaymentServiceServer) GetUser

func (UnimplementedPaymentServiceServer) RemoveSeat

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) Descriptor() ([]byte, []int)

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetEmail

func (x *User) GetEmail() string

func (*User) GetId

func (x *User) GetId() string

func (*User) GetImage

func (x *User) GetImage() string

func (*User) GetName

func (x *User) GetName() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

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

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

func (*User) Validate

func (m *User) Validate() error

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

func (m *User) ValidateAll() error

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

Cause function returns cause value.

func (UserRequestValidationError) Error

Error satisfies the builtin error interface

func (UserRequestValidationError) ErrorName

func (e UserRequestValidationError) ErrorName() string

ErrorName returns error name.

func (UserRequestValidationError) Field

Field function returns field value.

func (UserRequestValidationError) Key

Key function returns key value.

func (UserRequestValidationError) Reason

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

Cause function returns cause value.

func (UserResponseValidationError) Error

Error satisfies the builtin error interface

func (UserResponseValidationError) ErrorName

func (e UserResponseValidationError) ErrorName() string

ErrorName returns error name.

func (UserResponseValidationError) Field

Field function returns field value.

func (UserResponseValidationError) Key

Key function returns key value.

func (UserResponseValidationError) Reason

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.

Jump to

Keyboard shortcuts

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