push

package
v1.16.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 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 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,
		},
	},
	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.
	AddToken(ctx context.Context, in *AddTokenRequest, opts ...grpc.CallOption) (*AddTokenResponse, 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.
	AddToken(context.Context, *AddTokenRequest) (*AddTokenResponse, error)
	// contains filtered or unexported methods
}

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

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

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