Documentation ¶
Index ¶
- func NewBoiler(c *pubsub.Client) boilerplate
- type Message
- func (m *Message) Get(key string) string
- func (m *Message) GetFeature() string
- func (m *Message) GetVersion() int
- func (m *Message) SetDeliveryOrder(order string) *Message
- func (m *Message) SetFeature(f string) *Message
- func (m *Message) SetStr(key, value string) *Message
- func (m *Message) SetVersion(v int) *Message
- type MsgHandler
- type PsubConnection
- func (c *PsubConnection) Log(a ...any)
- func (c *PsubConnection) Publish(ctx context.Context, topicID string, message Message) error
- func (c *PsubConnection) PublishRaw(ctx context.Context, topicID string, data []byte) error
- func (c *PsubConnection) SetLog(isLog bool)
- func (c *PsubConnection) SettingTopic(ctx context.Context, topicID string, setting pubsub.PublishSettings)
- func (c *PsubConnection) Subscribe(ctx context.Context, subID string, fn MsgHandler, opts ...*SubscribeOption) (*Subscriber, error)
- func (c *PsubConnection) Upsert(ctx context.Context, cmd UpsertCmd) error
- func (c *PsubConnection) UpsertMany(ctx context.Context, psubs []UpsertCmd) error
- func (c *PsubConnection) UpsertSubscriptions(ctx context.Context, cmd SubsInfo) error
- func (c *PsubConnection) UpsertTopic(ctx context.Context, topicID string) (*pubsub.Topic, error)
- type Sub
- type SubsInfo
- type SubscribeOption
- func (s *SubscribeOption) SetACKAll(ack bool) *SubscribeOption
- func (s *SubscribeOption) SetACKHook(f func(*pubsub.Message)) *SubscribeOption
- func (s *SubscribeOption) SetDeduplicate(isDuplicateFunc func(context.Context, *pubsub.Message) (bool, error)) *SubscribeOption
- func (s *SubscribeOption) SetIsLog(isLog bool) *SubscribeOption
- func (s *SubscribeOption) SetNACKHook(f func(*pubsub.Message)) *SubscribeOption
- func (s *SubscribeOption) SetReceiveSettings(settings pubsub.ReceiveSettings) *SubscribeOption
- func (s *SubscribeOption) SetRetry(retry bool) *SubscribeOption
- type Subscriber
- type UpsertCmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Message ¶
func NewMessage ¶
func (*Message) GetFeature ¶
func (*Message) GetVersion ¶
func (*Message) SetDeliveryOrder ¶
func (*Message) SetFeature ¶
func (*Message) SetVersion ¶
type PsubConnection ¶
var Connection *PsubConnection // for singleton usage
func Connect ¶
func Connect(ctx context.Context, projectID string, opts ...option.ClientOption) (*PsubConnection, error)
func (*PsubConnection) Log ¶
func (c *PsubConnection) Log(a ...any)
func (*PsubConnection) PublishRaw ¶
func (*PsubConnection) SetLog ¶
func (c *PsubConnection) SetLog(isLog bool)
func (*PsubConnection) SettingTopic ¶
func (c *PsubConnection) SettingTopic(ctx context.Context, topicID string, setting pubsub.PublishSettings)
func (*PsubConnection) Subscribe ¶
func (c *PsubConnection) Subscribe(ctx context.Context, subID string, fn MsgHandler, opts ...*SubscribeOption) (*Subscriber, error)
Subscribe to the subscription
func (*PsubConnection) Upsert ¶
func (c *PsubConnection) Upsert(ctx context.Context, cmd UpsertCmd) error
func (*PsubConnection) UpsertMany ¶
func (c *PsubConnection) UpsertMany(ctx context.Context, psubs []UpsertCmd) error
func (*PsubConnection) UpsertSubscriptions ¶
func (c *PsubConnection) UpsertSubscriptions(ctx context.Context, cmd SubsInfo) error
func (*PsubConnection) UpsertTopic ¶
type Sub ¶
type Sub struct { ID string Config *pubsub.SubscriptionConfig }
type SubsInfo ¶
type SubsInfo struct { Subs []Sub DefaultConfig pubsub.SubscriptionConfig }
type SubscribeOption ¶
type SubscribeOption struct { ACKErr *bool RetrySubscribe *bool // default: true IsLog *bool //default: false DeduplicateFunc func(context.Context, *pubsub.Message) (bool, error) // return true if message duplicated ACKHook func(*pubsub.Message) NACKHook func(*pubsub.Message) ReceiveSettings *pubsub.ReceiveSettings }
func NewSubscribeOption ¶
func NewSubscribeOption() *SubscribeOption
func (*SubscribeOption) SetACKAll ¶ added in v1.0.1
func (s *SubscribeOption) SetACKAll(ack bool) *SubscribeOption
func (*SubscribeOption) SetACKHook ¶ added in v1.0.1
func (s *SubscribeOption) SetACKHook(f func(*pubsub.Message)) *SubscribeOption
SetACKHook not apply for deduplicate ack()
func (*SubscribeOption) SetDeduplicate ¶ added in v1.0.1
func (s *SubscribeOption) SetDeduplicate(isDuplicateFunc func(context.Context, *pubsub.Message) (bool, error)) *SubscribeOption
func (*SubscribeOption) SetIsLog ¶ added in v1.0.2
func (s *SubscribeOption) SetIsLog(isLog bool) *SubscribeOption
func (*SubscribeOption) SetNACKHook ¶ added in v1.0.1
func (s *SubscribeOption) SetNACKHook(f func(*pubsub.Message)) *SubscribeOption
func (*SubscribeOption) SetReceiveSettings ¶ added in v1.0.1
func (s *SubscribeOption) SetReceiveSettings(settings pubsub.ReceiveSettings) *SubscribeOption
func (*SubscribeOption) SetRetry ¶ added in v1.0.1
func (s *SubscribeOption) SetRetry(retry bool) *SubscribeOption
type Subscriber ¶
type Subscriber struct { ID string Sub *pubsub.Subscription CancelFunc context.CancelFunc // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.