push

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TokenType_name = map[int32]string{
		0: "UNKNOWN",
		1: "FCM_ANDROID",
		2: "FCM_APNS",
	}
	TokenType_value = map[string]int32{
		"UNKNOWN":     0,
		"FCM_ANDROID": 1,
		"FCM_APNS":    2,
	}
)

Enum value maps for TokenType.

View Source
var (
	AddTokenResponse_Result_name = map[int32]string{
		0: "OK",
		1: "INVALID_PUSH_TOKEN",
	}
	AddTokenResponse_Result_value = map[string]int32{
		"OK":                 0,
		"INVALID_PUSH_TOKEN": 1,
	}
)

Enum value maps for AddTokenResponse_Result.

View Source
var (
	RemoveTokenResponse_Result_name = map[int32]string{
		0: "OK",
	}
	RemoveTokenResponse_Result_value = map[string]int32{
		"OK": 0,
	}
)

Enum value maps for RemoveTokenResponse_Result.

View Source
var File_push_v1_push_service_proto protoreflect.FileDescriptor
View Source
var Push_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "code.push.v1.Push",
	HandlerType: (*PushServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AddToken",
			Handler:    _Push_AddToken_Handler,
		},
		{
			MethodName: "RemoveToken",
			Handler:    _Push_RemoveToken_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "push/v1/push_service.proto",
}

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

Functions

func RegisterPushServer

func RegisterPushServer(s grpc.ServiceRegistrar, srv PushServer)

Types

type AddTokenRequest

type AddTokenRequest struct {

	// The public key of the owner account that signed this request message.
	OwnerAccountId *v1.SolanaAccountId `protobuf:"bytes,1,opt,name=owner_account_id,json=ownerAccountId,proto3" json:"owner_account_id,omitempty"`
	// The signature is of serialize(AddTokenRequest) without this field set
	// using the private key of owner_account_id. This provides an authentication
	// mechanism to the RPC.
	Signature *v1.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	// The data container where the push token will be stored.
	ContainerId *v1.DataContainerId `protobuf:"bytes,3,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
	// The push token to store
	PushToken string `protobuf:"bytes,4,opt,name=push_token,json=pushToken,proto3" json:"push_token,omitempty"`
	// The type of push token
	TokenType TokenType `protobuf:"varint,5,opt,name=token_type,json=tokenType,proto3,enum=code.push.v1.TokenType" json:"token_type,omitempty"`
	// The instance of the app install where the push token was generated. Ideally,
	// the push token is unique to the install.
	AppInstall *v1.AppInstallId `protobuf:"bytes,6,opt,name=app_install,json=appInstall,proto3" json:"app_install,omitempty"`
	// contains filtered or unexported fields
}

func (*AddTokenRequest) Descriptor deprecated

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

Deprecated: Use AddTokenRequest.ProtoReflect.Descriptor instead.

func (*AddTokenRequest) GetAppInstall

func (x *AddTokenRequest) GetAppInstall() *v1.AppInstallId

func (*AddTokenRequest) GetContainerId

func (x *AddTokenRequest) GetContainerId() *v1.DataContainerId

func (*AddTokenRequest) GetOwnerAccountId

func (x *AddTokenRequest) GetOwnerAccountId() *v1.SolanaAccountId

func (*AddTokenRequest) GetPushToken

func (x *AddTokenRequest) GetPushToken() string

func (*AddTokenRequest) GetSignature

func (x *AddTokenRequest) GetSignature() *v1.Signature

func (*AddTokenRequest) GetTokenType

func (x *AddTokenRequest) GetTokenType() TokenType

func (*AddTokenRequest) ProtoMessage

func (*AddTokenRequest) ProtoMessage()

func (*AddTokenRequest) ProtoReflect

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

func (*AddTokenRequest) Reset

func (x *AddTokenRequest) Reset()

func (*AddTokenRequest) String

func (x *AddTokenRequest) String() string

func (*AddTokenRequest) Validate

func (m *AddTokenRequest) Validate() error

Validate checks the field values on AddTokenRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type AddTokenRequestValidationError

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

AddTokenRequestValidationError is the validation error returned by AddTokenRequest.Validate if the designated constraints aren't met.

func (AddTokenRequestValidationError) Cause

Cause function returns cause value.

func (AddTokenRequestValidationError) Error

Error satisfies the builtin error interface

func (AddTokenRequestValidationError) ErrorName

func (e AddTokenRequestValidationError) ErrorName() string

ErrorName returns error name.

func (AddTokenRequestValidationError) Field

Field function returns field value.

func (AddTokenRequestValidationError) Key

Key function returns key value.

func (AddTokenRequestValidationError) Reason

Reason function returns reason value.

type AddTokenResponse

type AddTokenResponse struct {
	Result AddTokenResponse_Result `protobuf:"varint,1,opt,name=result,proto3,enum=code.push.v1.AddTokenResponse_Result" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*AddTokenResponse) Descriptor deprecated

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

Deprecated: Use AddTokenResponse.ProtoReflect.Descriptor instead.

func (*AddTokenResponse) GetResult

func (*AddTokenResponse) ProtoMessage

func (*AddTokenResponse) ProtoMessage()

func (*AddTokenResponse) ProtoReflect

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

func (*AddTokenResponse) Reset

func (x *AddTokenResponse) Reset()

func (*AddTokenResponse) String

func (x *AddTokenResponse) String() string

func (*AddTokenResponse) Validate

func (m *AddTokenResponse) Validate() error

Validate checks the field values on AddTokenResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type AddTokenResponseValidationError

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

AddTokenResponseValidationError is the validation error returned by AddTokenResponse.Validate if the designated constraints aren't met.

func (AddTokenResponseValidationError) Cause

Cause function returns cause value.

func (AddTokenResponseValidationError) Error

Error satisfies the builtin error interface

func (AddTokenResponseValidationError) ErrorName

ErrorName returns error name.

func (AddTokenResponseValidationError) Field

Field function returns field value.

func (AddTokenResponseValidationError) Key

Key function returns key value.

func (AddTokenResponseValidationError) Reason

Reason function returns reason value.

type AddTokenResponse_Result

type AddTokenResponse_Result int32
const (
	AddTokenResponse_OK AddTokenResponse_Result = 0
	// The push token is invalid and wasn't stored.
	AddTokenResponse_INVALID_PUSH_TOKEN AddTokenResponse_Result = 1
)

func (AddTokenResponse_Result) Descriptor

func (AddTokenResponse_Result) Enum

func (AddTokenResponse_Result) EnumDescriptor deprecated

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

Deprecated: Use AddTokenResponse_Result.Descriptor instead.

func (AddTokenResponse_Result) Number

func (AddTokenResponse_Result) String

func (x AddTokenResponse_Result) String() string

func (AddTokenResponse_Result) Type

type PushClient

type PushClient interface {
	// AddToken stores a push token in a data container. The call is idempotent
	// and adding an existing valid token will not fail. Token types will be
	// validated against the user agent and any mismatches will result in an
	// INVALID_ARGUMENT status error.
	//
	// The token will be unlinked from any and all other accounts that it was
	// previously bound to.
	AddToken(ctx context.Context, in *AddTokenRequest, opts ...grpc.CallOption) (*AddTokenResponse, error)
	// RemoveToken removes the provided push token from the account.
	//
	// The provided token must be bound to the current account.
	// Otherwise, the RPC will succeed with without removal.
	RemoveToken(ctx context.Context, in *RemoveTokenRequest, opts ...grpc.CallOption) (*RemoveTokenResponse, error)
}

PushClient is the client API for Push 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 NewPushClient

func NewPushClient(cc grpc.ClientConnInterface) PushClient

type PushServer

type PushServer interface {
	// AddToken stores a push token in a data container. The call is idempotent
	// and adding an existing valid token will not fail. Token types will be
	// validated against the user agent and any mismatches will result in an
	// INVALID_ARGUMENT status error.
	//
	// The token will be unlinked from any and all other accounts that it was
	// previously bound to.
	AddToken(context.Context, *AddTokenRequest) (*AddTokenResponse, error)
	// RemoveToken removes the provided push token from the account.
	//
	// The provided token must be bound to the current account.
	// Otherwise, the RPC will succeed with without removal.
	RemoveToken(context.Context, *RemoveTokenRequest) (*RemoveTokenResponse, error)
	// contains filtered or unexported methods
}

PushServer is the server API for Push service. All implementations must embed UnimplementedPushServer for forward compatibility

type RemoveTokenRequest added in v1.18.0

type RemoveTokenRequest struct {

	// The public key of the owner account that signed this request message.
	OwnerAccountId *v1.SolanaAccountId `protobuf:"bytes,1,opt,name=owner_account_id,json=ownerAccountId,proto3" json:"owner_account_id,omitempty"`
	// The signature is of serialize(AddTokenRequest) without this field set
	// using the private key of owner_account_id. This provides an authentication
	// mechanism to the RPC.
	Signature *v1.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	// The data container where the push token was stored.
	ContainerId *v1.DataContainerId `protobuf:"bytes,3,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
	// The push token to remove.
	PushToken string `protobuf:"bytes,4,opt,name=push_token,json=pushToken,proto3" json:"push_token,omitempty"`
	// The type of push token to remove.
	TokenType TokenType `protobuf:"varint,5,opt,name=token_type,json=tokenType,proto3,enum=code.push.v1.TokenType" json:"token_type,omitempty"`
	// contains filtered or unexported fields
}

func (*RemoveTokenRequest) Descriptor deprecated added in v1.18.0

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

Deprecated: Use RemoveTokenRequest.ProtoReflect.Descriptor instead.

func (*RemoveTokenRequest) GetContainerId added in v1.18.0

func (x *RemoveTokenRequest) GetContainerId() *v1.DataContainerId

func (*RemoveTokenRequest) GetOwnerAccountId added in v1.18.0

func (x *RemoveTokenRequest) GetOwnerAccountId() *v1.SolanaAccountId

func (*RemoveTokenRequest) GetPushToken added in v1.18.0

func (x *RemoveTokenRequest) GetPushToken() string

func (*RemoveTokenRequest) GetSignature added in v1.18.0

func (x *RemoveTokenRequest) GetSignature() *v1.Signature

func (*RemoveTokenRequest) GetTokenType added in v1.18.0

func (x *RemoveTokenRequest) GetTokenType() TokenType

func (*RemoveTokenRequest) ProtoMessage added in v1.18.0

func (*RemoveTokenRequest) ProtoMessage()

func (*RemoveTokenRequest) ProtoReflect added in v1.18.0

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

func (*RemoveTokenRequest) Reset added in v1.18.0

func (x *RemoveTokenRequest) Reset()

func (*RemoveTokenRequest) String added in v1.18.0

func (x *RemoveTokenRequest) String() string

func (*RemoveTokenRequest) Validate added in v1.18.0

func (m *RemoveTokenRequest) Validate() error

Validate checks the field values on RemoveTokenRequest with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type RemoveTokenRequestValidationError added in v1.18.0

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

RemoveTokenRequestValidationError is the validation error returned by RemoveTokenRequest.Validate if the designated constraints aren't met.

func (RemoveTokenRequestValidationError) Cause added in v1.18.0

Cause function returns cause value.

func (RemoveTokenRequestValidationError) Error added in v1.18.0

Error satisfies the builtin error interface

func (RemoveTokenRequestValidationError) ErrorName added in v1.18.0

ErrorName returns error name.

func (RemoveTokenRequestValidationError) Field added in v1.18.0

Field function returns field value.

func (RemoveTokenRequestValidationError) Key added in v1.18.0

Key function returns key value.

func (RemoveTokenRequestValidationError) Reason added in v1.18.0

Reason function returns reason value.

type RemoveTokenResponse added in v1.18.0

type RemoveTokenResponse struct {
	Result RemoveTokenResponse_Result `protobuf:"varint,1,opt,name=result,proto3,enum=code.push.v1.RemoveTokenResponse_Result" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*RemoveTokenResponse) Descriptor deprecated added in v1.18.0

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

Deprecated: Use RemoveTokenResponse.ProtoReflect.Descriptor instead.

func (*RemoveTokenResponse) GetResult added in v1.18.0

func (*RemoveTokenResponse) ProtoMessage added in v1.18.0

func (*RemoveTokenResponse) ProtoMessage()

func (*RemoveTokenResponse) ProtoReflect added in v1.18.0

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

func (*RemoveTokenResponse) Reset added in v1.18.0

func (x *RemoveTokenResponse) Reset()

func (*RemoveTokenResponse) String added in v1.18.0

func (x *RemoveTokenResponse) String() string

func (*RemoveTokenResponse) Validate added in v1.18.0

func (m *RemoveTokenResponse) Validate() error

Validate checks the field values on RemoveTokenResponse with the rules defined in the proto definition for this message. If any rules are violated, an error is returned.

type RemoveTokenResponseValidationError added in v1.18.0

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

RemoveTokenResponseValidationError is the validation error returned by RemoveTokenResponse.Validate if the designated constraints aren't met.

func (RemoveTokenResponseValidationError) Cause added in v1.18.0

Cause function returns cause value.

func (RemoveTokenResponseValidationError) Error added in v1.18.0

Error satisfies the builtin error interface

func (RemoveTokenResponseValidationError) ErrorName added in v1.18.0

ErrorName returns error name.

func (RemoveTokenResponseValidationError) Field added in v1.18.0

Field function returns field value.

func (RemoveTokenResponseValidationError) Key added in v1.18.0

Key function returns key value.

func (RemoveTokenResponseValidationError) Reason added in v1.18.0

Reason function returns reason value.

type RemoveTokenResponse_Result added in v1.18.0

type RemoveTokenResponse_Result int32
const (
	RemoveTokenResponse_OK RemoveTokenResponse_Result = 0
)

func (RemoveTokenResponse_Result) Descriptor added in v1.18.0

func (RemoveTokenResponse_Result) Enum added in v1.18.0

func (RemoveTokenResponse_Result) EnumDescriptor deprecated added in v1.18.0

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

Deprecated: Use RemoveTokenResponse_Result.Descriptor instead.

func (RemoveTokenResponse_Result) Number added in v1.18.0

func (RemoveTokenResponse_Result) String added in v1.18.0

func (RemoveTokenResponse_Result) Type added in v1.18.0

type TokenType

type TokenType int32
const (
	TokenType_UNKNOWN TokenType = 0
	// FCM registration token for an Android device
	TokenType_FCM_ANDROID TokenType = 1
	// FCM registration token or an iOS device
	TokenType_FCM_APNS TokenType = 2
)

func (TokenType) Descriptor

func (TokenType) Descriptor() protoreflect.EnumDescriptor

func (TokenType) Enum

func (x TokenType) Enum() *TokenType

func (TokenType) EnumDescriptor deprecated

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

Deprecated: Use TokenType.Descriptor instead.

func (TokenType) Number

func (x TokenType) Number() protoreflect.EnumNumber

func (TokenType) String

func (x TokenType) String() string

func (TokenType) Type

type UnimplementedPushServer

type UnimplementedPushServer struct {
}

UnimplementedPushServer must be embedded to have forward compatible implementations.

func (UnimplementedPushServer) AddToken

func (UnimplementedPushServer) RemoveToken added in v1.18.0

type UnsafePushServer

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

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

Jump to

Keyboard shortcuts

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