Documentation
¶
Index ¶
Constants ¶
View Source
const ( ResourceVendorGoogleCloudPlatform = "gcp" ResourceVendorAmazonWebService = "aws" ResourceVendorKafka = "kafka" )
View Source
const ( ResourceTypeTopic = "topic" ResourceTypeSubscription = "subscription" ResourceTypeQueue = "queue" )
View Source
const (
//ServiceID represents gloud msg pubsub service id.
ServiceID = "msg"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface {
Push(ctx context.Context, dest *Resource, message *Message) (Result, error)
PullN(ctx context.Context, source *Resource, count int, nack bool) ([]*Message, error)
SetupResource(resource *ResourceSetup) (*Resource, error)
DeleteResource(resource *Resource) error
Close() error
}
type Config ¶
type Config struct {
Topic *Resource
Labels map[string]string
Attributes map[string]string
AckDeadline time.Duration
RetentionDuration time.Duration
RetainAckedMessages bool
}
Config represent a subscription config
type CreateRequest ¶
type CreateRequest struct {
Credentials string
Resources []*ResourceSetup
}
CreateRequest represents a create resource request
func (*CreateRequest) Init ¶
func (r *CreateRequest) Init() error
func (*CreateRequest) Validate ¶
func (r *CreateRequest) Validate() error
type CreateResponse ¶
type CreateResponse struct {
Resources []*Resource
}
CreateResponse represents a create resource response
type DeleteRequest ¶
DeleteRequest represents a delete resource request
func (*DeleteRequest) Init ¶
func (r *DeleteRequest) Init() error
type DeleteResponse ¶
type DeleteResponse struct{}
DeleteResponse represents a delete resource response
type Message ¶
type PullRequest ¶
type PullRequest struct {
Credentials string
Source *Resource
TimeoutMs int
Count int
Nack bool `description:"flag indicates that the client will not or cannot process a Message passed to the Subscriber.Receive callback."`
UDF string
Expect interface{}
}
PullRequest represents a pull request
func (*PullRequest) Init ¶
func (r *PullRequest) Init() error
func (*PullRequest) Validate ¶
func (r *PullRequest) Validate() error
type PullResponse ¶
type PullResponse struct {
Messages []*Message
Assert *validator.AssertResponse
}
PullRequest represents a pull response
type PushRequest ¶
type PushRequest struct {
Credentials string
Dest *Resource
Messages []*Message
Source *location.Resource `` /* 126-byte string literal not displayed */
TimeoutMs int
UDF string
// contains filtered or unexported fields
}
PushRequest represents push request
func (*PushRequest) Init ¶
func (r *PushRequest) Init() error
func (*PushRequest) Validate ¶
func (r *PushRequest) Validate() error
type PushResponse ¶
type PushResponse struct {
Results []Result
}
PushResponse represents a push response
type Resource ¶
type Resource struct {
URL string
Brokers []string
Credentials string
Offset int
GroupID string
Partition int
ReplicationFactor int
Partitions int
ID string
Name string
Type string `description:"resource type: topic, subscription"`
Vendor string
Config interface{} `description:"vendor client config"`
// contains filtered or unexported fields
}
func NewResource ¶
NewResource creates a new resource
type ResourceSetup ¶
Resource represents resource setup
func NewResourceSetup ¶
func NewResourceSetup(resourceType, URL, credentials string, recreate bool, config *Config) *ResourceSetup
NewResourceSetup creates a new URL
func (*ResourceSetup) Validate ¶
func (r *ResourceSetup) Validate() error
Click to show internal directories.
Click to hide internal directories.