connection

package
v0.0.0-...-e165f0f Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

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

func (*Ack) GetMessageId

func (m *Ack) GetMessageId() string

func (*Ack) ProtoMessage

func (*Ack) ProtoMessage()

func (*Ack) Reset

func (m *Ack) Reset()

func (*Ack) String

func (m *Ack) String() string

func (*Ack) XXX_DiscardUnknown

func (m *Ack) XXX_DiscardUnknown()

func (*Ack) XXX_Marshal

func (m *Ack) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Ack) XXX_Merge

func (m *Ack) XXX_Merge(src proto.Message)

func (*Ack) XXX_Size

func (m *Ack) XXX_Size() int

func (*Ack) XXX_Unmarshal

func (m *Ack) XXX_Unmarshal(b []byte) error

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 valid to be assigned to ResponseType:
	//	*DownstreamResponse_Message
	ResponseType         isDownstreamResponse_ResponseType `protobuf_oneof:"response_type"`
	XXX_NoUnkeyedLiteral struct{}                          `json:"-"`
	XXX_unrecognized     []byte                            `json:"-"`
	XXX_sizecache        int32                             `json:"-"`
}

Response sent to the connected client from FCM.

func (*DownstreamResponse) Descriptor

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

func (*DownstreamResponse) GetMessage

func (m *DownstreamResponse) GetMessage() *Message

func (*DownstreamResponse) GetResponseType

func (m *DownstreamResponse) GetResponseType() isDownstreamResponse_ResponseType

func (*DownstreamResponse) ProtoMessage

func (*DownstreamResponse) ProtoMessage()

func (*DownstreamResponse) Reset

func (m *DownstreamResponse) Reset()

func (*DownstreamResponse) String

func (m *DownstreamResponse) String() string

func (*DownstreamResponse) XXX_DiscardUnknown

func (m *DownstreamResponse) XXX_DiscardUnknown()

func (*DownstreamResponse) XXX_Marshal

func (m *DownstreamResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DownstreamResponse) XXX_Merge

func (m *DownstreamResponse) XXX_Merge(src proto.Message)

func (*DownstreamResponse) XXX_OneofWrappers

func (*DownstreamResponse) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*DownstreamResponse) XXX_Size

func (m *DownstreamResponse) XXX_Size() int

func (*DownstreamResponse) XXX_Unmarshal

func (m *DownstreamResponse) XXX_Unmarshal(b []byte) error

type DownstreamResponse_Message

type DownstreamResponse_Message struct {
	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 *timestamp.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 *timestamp.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 */
	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
	XXX_unrecognized     []byte            `json:"-"`
	XXX_sizecache        int32             `json:"-"`
}

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

func (*Message) Descriptor

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

func (*Message) GetCreateTime

func (m *Message) GetCreateTime() *timestamp.Timestamp

func (*Message) GetData

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

func (*Message) GetExpireTime

func (m *Message) GetExpireTime() *timestamp.Timestamp

func (*Message) GetMessageId

func (m *Message) GetMessageId() string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) Reset

func (m *Message) Reset()

func (*Message) String

func (m *Message) String() string

func (*Message) XXX_DiscardUnknown

func (m *Message) XXX_DiscardUnknown()

func (*Message) XXX_Marshal

func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Message) XXX_Merge

func (m *Message) XXX_Merge(src proto.Message)

func (*Message) XXX_Size

func (m *Message) XXX_Size() int

func (*Message) XXX_Unmarshal

func (m *Message) XXX_Unmarshal(b []byte) error

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 valid to be assigned to RequestType:
	//	*UpstreamRequest_Ack
	RequestType          isUpstreamRequest_RequestType `protobuf_oneof:"request_type"`
	XXX_NoUnkeyedLiteral struct{}                      `json:"-"`
	XXX_unrecognized     []byte                        `json:"-"`
	XXX_sizecache        int32                         `json:"-"`
}

Request sent to FCM from the connected client.

func (*UpstreamRequest) Descriptor

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

func (*UpstreamRequest) GetAck

func (m *UpstreamRequest) GetAck() *Ack

func (*UpstreamRequest) GetRequestType

func (m *UpstreamRequest) GetRequestType() isUpstreamRequest_RequestType

func (*UpstreamRequest) ProtoMessage

func (*UpstreamRequest) ProtoMessage()

func (*UpstreamRequest) Reset

func (m *UpstreamRequest) Reset()

func (*UpstreamRequest) String

func (m *UpstreamRequest) String() string

func (*UpstreamRequest) XXX_DiscardUnknown

func (m *UpstreamRequest) XXX_DiscardUnknown()

func (*UpstreamRequest) XXX_Marshal

func (m *UpstreamRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*UpstreamRequest) XXX_Merge

func (m *UpstreamRequest) XXX_Merge(src proto.Message)

func (*UpstreamRequest) XXX_OneofWrappers

func (*UpstreamRequest) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*UpstreamRequest) XXX_Size

func (m *UpstreamRequest) XXX_Size() int

func (*UpstreamRequest) XXX_Unmarshal

func (m *UpstreamRequest) XXX_Unmarshal(b []byte) error

type UpstreamRequest_Ack

type UpstreamRequest_Ack struct {
	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