Documentation
¶
Index ¶
- Variables
- type MessageData
- func (*MessageData) Descriptor() ([]byte, []int)deprecated
- func (x *MessageData) GetData() []byte
- func (x *MessageData) GetFrom() string
- func (x *MessageData) GetId() string
- func (x *MessageData) GetMeta() map[string]string
- func (x *MessageData) GetTime() int64
- func (x *MessageData) GetTo() string
- func (x *MessageData) GetTopic() string
- func (*MessageData) ProtoMessage()
- func (x *MessageData) ProtoReflect() protoreflect.Message
- func (x *MessageData) Reset()
- func (x *MessageData) String() string
- type PushRequest
- func (*PushRequest) Descriptor() ([]byte, []int)deprecated
- func (x *PushRequest) GetData() []byte
- func (x *PushRequest) GetPush() string
- func (x *PushRequest) GetRespondAsync() bool
- func (x *PushRequest) GetTopic() string
- func (x *PushRequest) GetTtl() int32
- func (x *PushRequest) GetUrgency() string
- func (*PushRequest) ProtoMessage()
- func (x *PushRequest) ProtoReflect() protoreflect.Message
- func (x *PushRequest) Reset()
- func (x *PushRequest) String() string
- type PushResponse
- func (*PushResponse) Descriptor() ([]byte, []int)deprecated
- func (x *PushResponse) GetMessageId() string
- func (x *PushResponse) GetPushReceipt() string
- func (*PushResponse) ProtoMessage()
- func (x *PushResponse) ProtoReflect() protoreflect.Message
- func (x *PushResponse) Reset()
- func (x *PushResponse) String() string
- type Vapid
- func (*Vapid) Descriptor() ([]byte, []int)deprecated
- func (x *Vapid) GetData() []byte
- func (x *Vapid) GetK() []byte
- func (x *Vapid) GetTSignature() []byte
- func (x *Vapid) GetTType() []byte
- func (*Vapid) ProtoMessage()
- func (x *Vapid) ProtoReflect() protoreflect.Message
- func (x *Vapid) Reset()
- func (x *Vapid) String() string
- type Via
- type WebpushMessage
- func (*WebpushMessage) Descriptor() ([]byte, []int)deprecated
- func (x *WebpushMessage) GetContentEncoding() int32
- func (x *WebpushMessage) GetData() []byte
- func (x *WebpushMessage) GetFrom() string
- func (x *WebpushMessage) GetId() string
- func (x *WebpushMessage) GetPath() []*Via
- func (x *WebpushMessage) GetPush() string
- func (x *WebpushMessage) GetSender() *Vapid
- func (x *WebpushMessage) GetTtl() int32
- func (*WebpushMessage) ProtoMessage()
- func (x *WebpushMessage) ProtoReflect() protoreflect.Message
- func (x *WebpushMessage) Reset()
- func (x *WebpushMessage) String() string
Constants ¶
This section is empty.
Variables ¶
var File_webpush_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type MessageData ¶
type MessageData struct { // Time when the message was sent, according to the sender clock. Time int64 `protobuf:"varint,1,opt,name=time,proto3" json:"time,omitempty"` // Original ID. If missing, the envelope ID will be used. Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` // Original destination To string `protobuf:"bytes,3,opt,name=to,proto3" json:"to,omitempty"` From string `protobuf:"bytes,4,opt,name=from,proto3" json:"from,omitempty"` Topic string `protobuf:"bytes,5,opt,name=topic,proto3" json:"topic,omitempty"` Meta map[string]string `` /* 149-byte string literal not displayed */ Data []byte `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
Common fields to be encoded in the 'data' proto
func (*MessageData) Descriptor
deprecated
func (*MessageData) Descriptor() ([]byte, []int)
Deprecated: Use MessageData.ProtoReflect.Descriptor instead.
func (*MessageData) GetData ¶
func (x *MessageData) GetData() []byte
func (*MessageData) GetFrom ¶
func (x *MessageData) GetFrom() string
func (*MessageData) GetId ¶
func (x *MessageData) GetId() string
func (*MessageData) GetMeta ¶
func (x *MessageData) GetMeta() map[string]string
func (*MessageData) GetTime ¶
func (x *MessageData) GetTime() int64
func (*MessageData) GetTo ¶
func (x *MessageData) GetTo() string
func (*MessageData) GetTopic ¶
func (x *MessageData) GetTopic() string
func (*MessageData) ProtoMessage ¶
func (*MessageData) ProtoMessage()
func (*MessageData) ProtoReflect ¶
func (x *MessageData) ProtoReflect() protoreflect.Message
func (*MessageData) Reset ¶
func (x *MessageData) Reset()
func (*MessageData) String ¶
func (x *MessageData) String() string
type PushRequest ¶
type PushRequest struct { // The value returned in the SubscribeResponse push, without the hostname. Push string `protobuf:"bytes,1,opt,name=push,proto3" json:"push,omitempty"` Ttl int32 `protobuf:"varint,2,opt,name=ttl,proto3" json:"ttl,omitempty"` // aes128gcm encrypted Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` Urgency string `protobuf:"bytes,4,opt,name=urgency,proto3" json:"urgency,omitempty"` // Prefer header indicating delivery receipt request. RespondAsync bool `protobuf:"varint,5,opt,name=respond_async,json=respondAsync,proto3" json:"respond_async,omitempty"` Topic string `protobuf:"bytes,6,opt,name=topic,proto3" json:"topic,omitempty"` // contains filtered or unexported fields }
func (*PushRequest) Descriptor
deprecated
func (*PushRequest) Descriptor() ([]byte, []int)
Deprecated: Use PushRequest.ProtoReflect.Descriptor instead.
func (*PushRequest) GetData ¶
func (x *PushRequest) GetData() []byte
func (*PushRequest) GetPush ¶
func (x *PushRequest) GetPush() string
func (*PushRequest) GetRespondAsync ¶
func (x *PushRequest) GetRespondAsync() bool
func (*PushRequest) GetTopic ¶
func (x *PushRequest) GetTopic() string
func (*PushRequest) GetTtl ¶
func (x *PushRequest) GetTtl() int32
func (*PushRequest) GetUrgency ¶
func (x *PushRequest) GetUrgency() string
func (*PushRequest) ProtoMessage ¶
func (*PushRequest) ProtoMessage()
func (*PushRequest) ProtoReflect ¶
func (x *PushRequest) ProtoReflect() protoreflect.Message
func (*PushRequest) Reset ¶
func (x *PushRequest) Reset()
func (*PushRequest) String ¶
func (x *PushRequest) String() string
type PushResponse ¶
type PushResponse struct { MessageId string `protobuf:"bytes,1,opt,name=message_id,json=messageId,proto3" json:"message_id,omitempty"` // If request includes the respond_async parameter. // PushReceipt string `protobuf:"bytes,2,opt,name=push_receipt,json=pushReceipt,proto3" json:"push_receipt,omitempty"` // contains filtered or unexported fields }
func (*PushResponse) Descriptor
deprecated
func (*PushResponse) Descriptor() ([]byte, []int)
Deprecated: Use PushResponse.ProtoReflect.Descriptor instead.
func (*PushResponse) GetMessageId ¶
func (x *PushResponse) GetMessageId() string
func (*PushResponse) GetPushReceipt ¶
func (x *PushResponse) GetPushReceipt() string
func (*PushResponse) ProtoMessage ¶
func (*PushResponse) ProtoMessage()
func (*PushResponse) ProtoReflect ¶
func (x *PushResponse) ProtoReflect() protoreflect.Message
func (*PushResponse) Reset ¶
func (x *PushResponse) Reset()
func (*PushResponse) String ¶
func (x *PushResponse) String() string
type Vapid ¶
type Vapid struct { // json payload of VAPID ( without base64 encoding) // Can also be a proto message when used over other transports. // Verification requires converting back to base64 ! // Decoded to reduce the binary size Data []byte `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"` // Public key of the signer, 64 bytes, EC256, decoded. // Included in 'k' parameter for HTTP. K []byte `protobuf:"bytes,4,opt,name=k,proto3" json:"k,omitempty"` // If empty, it is assumed to be the constant value {typ=JWT,alg=ES256} TType []byte `protobuf:"bytes,32,opt,name=t_type,json=tType,proto3" json:"t_type,omitempty"` // Decoded TSignature []byte `protobuf:"bytes,33,opt,name=t_signature,json=tSignature,proto3" json:"t_signature,omitempty"` // contains filtered or unexported fields }
Vapid is the proto variant of a Webpush JWT. This is a more compact representation, without base64 overhead
For HTTP, included in Authorization header: Authorization: vapid t=B64url k=B64url
Decoded t is of form: { "typ": "JWT", "alg": "ES256" }.JWT.SIG
{ "crv":"P-256",
"kty":"EC", "x":"DUfHPKLVFQzVvnCPGyfucbECzPDa7rWbXriLcysAjEc", "y":"F6YK5h4SDYic-dRuU_RCPCfA5aq9ojSwk5Y2EmClBPs" }
func (*Vapid) Descriptor
deprecated
func (*Vapid) GetTSignature ¶
func (*Vapid) ProtoMessage ¶
func (*Vapid) ProtoMessage()
func (*Vapid) ProtoReflect ¶
func (x *Vapid) ProtoReflect() protoreflect.Message
type Via ¶
type Via struct { Time int64 `protobuf:"varint,1,opt,name=time,proto3" json:"time,omitempty"` Vip string `protobuf:"bytes,2,opt,name=vip,proto3" json:"vip,omitempty"` // contains filtered or unexported fields }
func (*Via) Descriptor
deprecated
func (*Via) ProtoMessage ¶
func (*Via) ProtoMessage()
func (*Via) ProtoReflect ¶
func (x *Via) ProtoReflect() protoreflect.Message
type WebpushMessage ¶
type WebpushMessage struct { // Unique in context of the origin // For webpush, generated by the original server (from subscription), as Location: // Example: https://push.example.net/message/qDIYHNcfAIPP_5ITvURr-d6BGt Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Plaintext = 0 // aes128gcm = 1 ContentEncoding int32 `protobuf:"varint,7,opt,name=content_encoding,json=contentEncoding,proto3" json:"content_encoding,omitempty"` // If encoding is "1" - aes128gcm // Otherwise it is a plaintext message. Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // Message path Path []*Via `protobuf:"bytes,6,rep,name=path,proto3" json:"path,omitempty"` Ttl int32 `protobuf:"varint,9,opt,name=ttl,proto3" json:"ttl,omitempty"` // Maps to the SubscribeResponse push parameter, returned as Link rel="urn:ietf:params:push" // in the push promise. Push string `protobuf:"bytes,2,opt,name=push,proto3" json:"push,omitempty"` // Identifies the sender - compact form. Sender *Vapid `protobuf:"bytes,4,opt,name=sender,proto3" json:"sender,omitempty"` // URL or IPv6, extracted from the VAPID of the sender or other // form of authentication. From string `protobuf:"bytes,5,opt,name=from,proto3" json:"from,omitempty"` // contains filtered or unexported fields }
Message is returned as PUSH PROMISE frames in the spec. The alternative protocol wraps it in Any field or other framing.
func (*WebpushMessage) Descriptor
deprecated
func (*WebpushMessage) Descriptor() ([]byte, []int)
Deprecated: Use WebpushMessage.ProtoReflect.Descriptor instead.
func (*WebpushMessage) GetContentEncoding ¶
func (x *WebpushMessage) GetContentEncoding() int32
func (*WebpushMessage) GetData ¶
func (x *WebpushMessage) GetData() []byte
func (*WebpushMessage) GetFrom ¶
func (x *WebpushMessage) GetFrom() string
func (*WebpushMessage) GetId ¶
func (x *WebpushMessage) GetId() string
func (*WebpushMessage) GetPath ¶
func (x *WebpushMessage) GetPath() []*Via
func (*WebpushMessage) GetPush ¶
func (x *WebpushMessage) GetPush() string
func (*WebpushMessage) GetSender ¶
func (x *WebpushMessage) GetSender() *Vapid
func (*WebpushMessage) GetTtl ¶
func (x *WebpushMessage) GetTtl() int32
func (*WebpushMessage) ProtoMessage ¶
func (*WebpushMessage) ProtoMessage()
func (*WebpushMessage) ProtoReflect ¶
func (x *WebpushMessage) ProtoReflect() protoreflect.Message
func (*WebpushMessage) Reset ¶
func (x *WebpushMessage) Reset()
func (*WebpushMessage) String ¶
func (x *WebpushMessage) String() string