connection

package
v0.0.0-...-a8a6208 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_google_firebase_fcm_connection_v1alpha1_connection_api_proto protoreflect.FileDescriptor

Functions

func RegisterConnectionApiServer

func RegisterConnectionApiServer(s *grpc.Server, srv ConnectionApiServer)

Types

type Ack

type Ack struct {

	// Id of message being acknowledged
	MessageId string `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
	// contains filtered or unexported fields
}

Acknowledgement to indicate a client successfully received an FCM message.

If a message is not acked, FCM will continously resend the message until it expires. Duplicate delivery in this case is working as intended.

func (*Ack) Descriptor deprecated

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

Deprecated: Use Ack.ProtoReflect.Descriptor instead.

func (*Ack) GetMessageId

func (x *Ack) GetMessageId() string

func (*Ack) ProtoMessage

func (*Ack) ProtoMessage()

func (*Ack) ProtoReflect

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

func (*Ack) Reset

func (x *Ack) Reset()

func (*Ack) String

func (x *Ack) String() string

type ConnectionApiClient

type ConnectionApiClient interface {
	// Creates a streaming connection with FCM to send messages and their
	// respective ACKs.
	//
	// The client credentials need to be passed in the [gRPC
	// Metadata](https://grpc.io/docs/guides/concepts.html#metadata). The Format
	// of the header is:
	//
	//	Key: "authorization"
	//	Value: "Checkin [client_id:secret]"
	//
	// The project's API key also needs to be sent to authorize the project.
	// That can be set in the X-Goog-Api-Key Metadata header.
	Connect(ctx context.Context, opts ...grpc.CallOption) (ConnectionApi_ConnectClient, error)
}

ConnectionApiClient is the client API for ConnectionApi service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type ConnectionApiServer

type ConnectionApiServer interface {
	// Creates a streaming connection with FCM to send messages and their
	// respective ACKs.
	//
	// The client credentials need to be passed in the [gRPC
	// Metadata](https://grpc.io/docs/guides/concepts.html#metadata). The Format
	// of the header is:
	//
	//	Key: "authorization"
	//	Value: "Checkin [client_id:secret]"
	//
	// The project's API key also needs to be sent to authorize the project.
	// That can be set in the X-Goog-Api-Key Metadata header.
	Connect(ConnectionApi_ConnectServer) error
}

ConnectionApiServer is the server API for ConnectionApi service.

type ConnectionApi_ConnectClient

type ConnectionApi_ConnectClient interface {
	Send(*UpstreamRequest) error
	Recv() (*DownstreamResponse, error)
	grpc.ClientStream
}

type ConnectionApi_ConnectServer

type ConnectionApi_ConnectServer interface {
	Send(*DownstreamResponse) error
	Recv() (*UpstreamRequest, error)
	grpc.ServerStream
}

type DownstreamResponse

type DownstreamResponse struct {

	// The type of response FCM is sending to the client.
	//
	// Types that are assignable to ResponseType:
	//
	//	*DownstreamResponse_Message
	ResponseType isDownstreamResponse_ResponseType `protobuf_oneof:"response_type"`
	// contains filtered or unexported fields
}

Response sent to the connected client from FCM.

func (*DownstreamResponse) Descriptor deprecated

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

Deprecated: Use DownstreamResponse.ProtoReflect.Descriptor instead.

func (*DownstreamResponse) GetMessage

func (x *DownstreamResponse) GetMessage() *Message

func (*DownstreamResponse) GetResponseType

func (m *DownstreamResponse) GetResponseType() isDownstreamResponse_ResponseType

func (*DownstreamResponse) ProtoMessage

func (*DownstreamResponse) ProtoMessage()

func (*DownstreamResponse) ProtoReflect

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

func (*DownstreamResponse) Reset

func (x *DownstreamResponse) Reset()

func (*DownstreamResponse) String

func (x *DownstreamResponse) String() string

type DownstreamResponse_Message

type DownstreamResponse_Message struct {
	// Message sent to FCM via the [Send
	// API](https://firebase.google.com/docs/cloud-messaging/send-message)
	// targeting this client.
	Message *Message `protobuf:"bytes,1,opt,name=message,proto3,oneof"`
}

type Message

type Message struct {

	// The identifier of the message. Used to ack the message.
	MessageId string `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"`
	// Time the message was received in FCM.
	CreateTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
	// Expiry time of the message. Currently it is always 4 weeks.
	ExpireTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"`
	// The arbitrary payload set in the [Send
	// API](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#resource-message).
	Data map[string]string `` /* 149-byte string literal not displayed */
	// contains filtered or unexported fields
}

Message created through the [Send API](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#resource-message).

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetCreateTime

func (x *Message) GetCreateTime() *timestamppb.Timestamp

func (*Message) GetData

func (x *Message) GetData() map[string]string

func (*Message) GetExpireTime

func (x *Message) GetExpireTime() *timestamppb.Timestamp

func (*Message) GetMessageId

func (x *Message) GetMessageId() string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

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

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type UnimplementedConnectionApiServer

type UnimplementedConnectionApiServer struct {
}

UnimplementedConnectionApiServer can be embedded to have forward compatible implementations.

func (*UnimplementedConnectionApiServer) Connect

type UpstreamRequest

type UpstreamRequest struct {

	// The type of request the client is making to FCM.
	//
	// Types that are assignable to RequestType:
	//
	//	*UpstreamRequest_Ack
	RequestType isUpstreamRequest_RequestType `protobuf_oneof:"request_type"`
	// contains filtered or unexported fields
}

Request sent to FCM from the connected client.

func (*UpstreamRequest) Descriptor deprecated

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

Deprecated: Use UpstreamRequest.ProtoReflect.Descriptor instead.

func (*UpstreamRequest) GetAck

func (x *UpstreamRequest) GetAck() *Ack

func (*UpstreamRequest) GetRequestType

func (m *UpstreamRequest) GetRequestType() isUpstreamRequest_RequestType

func (*UpstreamRequest) ProtoMessage

func (*UpstreamRequest) ProtoMessage()

func (*UpstreamRequest) ProtoReflect

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

func (*UpstreamRequest) Reset

func (x *UpstreamRequest) Reset()

func (*UpstreamRequest) String

func (x *UpstreamRequest) String() string

type UpstreamRequest_Ack

type UpstreamRequest_Ack struct {
	// Message acknowledgement.
	Ack *Ack `protobuf:"bytes,1,opt,name=ack,proto3,oneof"`
}

Jump to

Keyboard shortcuts

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