Help us shape the future of Go! Take the 2026 Go Developer Survey

msg

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

README

Msg - Messaging Service

work in progress ...

Documentation

Index

Constants

View Source
const (
	ResourceVendorGoogleCloud      = "gc"
	ResourceVendorAmazonWebService = "aws"
)
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

func New added in v0.24.0

func New() endly.Service

New creates a new NoOperation service.

Types

type Client added in v0.24.0

type Client interface {
	Push(dest *Resource, message *Message) (Result, error)

	PullN(source *Resource, count int) ([]*Message, error)

	Create(resource *ResourceSetup) (*Resource, error)

	Delete(resource *Resource) error

	Close() error
}

func NewPubSubClient added in v0.24.0

func NewPubSubClient(context *endly.Context, dest *Resource, timeout time.Duration) (Client, error)

NewPubSubClient creates a new Client

type Config added in v0.24.0

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

func NewConfig added in v0.24.0

func NewConfig(topic string) *Config

NewConfig create new config

type CreateRequest added in v0.24.0

type CreateRequest struct {
	Resources []*ResourceSetup
}

CreateRequest represents a create resource request

func (*CreateRequest) Init added in v0.24.0

func (r *CreateRequest) Init() error

func (*CreateRequest) Validate added in v0.24.0

func (r *CreateRequest) Validate() error

type CreateResponse added in v0.24.0

type CreateResponse struct {
	Resources []*Resource
}

CreateResponse represents a create resource response

type DeleteRequest added in v0.24.0

type DeleteRequest struct {
	Resources []*Resource
}

DeleteRequest represents a delete resource request

func (*DeleteRequest) Init added in v0.24.0

func (r *DeleteRequest) Init() error

type DeleteResponse added in v0.24.0

type DeleteResponse struct{}

DeleteResponse represents a delete resource response

type Message

type Message struct {
	ID         string
	Subject    string
	Attributes map[string]string
	Data       interface{}
}

func (*Message) Expand added in v0.24.0

func (m *Message) Expand(state data.Map) *Message

type PullRequest added in v0.24.0

type PullRequest struct {
	Source    *Resource
	TimeoutMs int
	Count     int
	UDF       string
}

PullRequest represents a pull request

func (*PullRequest) Init added in v0.24.0

func (r *PullRequest) Init() error

func (*PullRequest) Validate added in v0.24.0

func (r *PullRequest) Validate() error

type PullResponse added in v0.24.0

type PullResponse struct {
	Messages []*Message
}

PullRequest represents a pull response

type PushRequest added in v0.24.0

type PushRequest struct {
	Dest      *Resource
	Messages  []*Message
	Source    *url.Resource
	TimeoutMs int
	UDF       string
	// contains filtered or unexported fields
}

PushRequest represents push request

func (*PushRequest) Init added in v0.24.0

func (r *PushRequest) Init() error

func (*PushRequest) Validate added in v0.24.0

func (r *PushRequest) Validate() error

type PushResponse added in v0.24.0

type PushResponse struct {
	Results []Result
}

PushResponse represents a push response

type Resource added in v0.24.0

type Resource struct {
	URL         string
	Credentials string
	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 added in v0.24.0

func NewResource(resourceType, URL, credentials string) *Resource

NewResource creates a new resource

func (*Resource) Init added in v0.24.0

func (r *Resource) Init() error

Init initializes resource

type ResourceSetup added in v0.24.0

type ResourceSetup struct {
	Resource
	Recreate bool
	Config   *Config
}

Resource represents resource setup

func NewResourceSetup added in v0.24.0

func NewResourceSetup(resourceType, URL, credentials string, recreate bool, config *Config) *ResourceSetup

NewResourceSetup creates a new URL

func (*ResourceSetup) Init added in v0.24.0

func (r *ResourceSetup) Init() error

Init initializes setup resource

type Result added in v0.24.0

type Result interface{}

Jump to

Keyboard shortcuts

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