subscriptions

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "Subscriptions"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [3]string{"Get", "AddTable", "StopTable"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func NewAddTableEndpoint

func NewAddTableEndpoint(s Service) goa.Endpoint

NewAddTableEndpoint returns an endpoint function that calls the method "AddTable" of service "Subscriptions".

func NewGetEndpoint

func NewGetEndpoint(s Service) goa.Endpoint

NewGetEndpoint returns an endpoint function that calls the method "Get" of service "Subscriptions".

func NewStopTableEndpoint

func NewStopTableEndpoint(s Service) goa.Endpoint

NewStopTableEndpoint returns an endpoint function that calls the method "StopTable" of service "Subscriptions".

Types

type Client

type Client struct {
	GetEndpoint       goa.Endpoint
	AddTableEndpoint  goa.Endpoint
	StopTableEndpoint goa.Endpoint
}

Client is the "Subscriptions" service client.

func NewClient

func NewClient(get, addTable, stopTable goa.Endpoint) *Client

NewClient initializes a "Subscriptions" service client given the endpoints.

func (*Client) AddTable

func (c *Client) AddTable(ctx context.Context, p *SubscriptionPublishedTable) (res *Subscription, err error)

AddTable calls the "AddTable" endpoint of the "Subscriptions" service.

func (*Client) Get

func (c *Client) Get(ctx context.Context) (res *Subscription, err error)

Get calls the "Get" endpoint of the "Subscriptions" service.

func (*Client) StopTable

func (c *Client) StopTable(ctx context.Context, p *SubscriptionPublishedTable) (res *Subscription, err error)

StopTable calls the "StopTable" endpoint of the "Subscriptions" service.

type Endpoints

type Endpoints struct {
	Get       goa.Endpoint
	AddTable  goa.Endpoint
	StopTable goa.Endpoint
}

Endpoints wraps the "Subscriptions" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "Subscriptions" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "Subscriptions" service endpoints.

type Service

type Service interface {
	// Get current subscription data
	Get(context.Context) (res *Subscription, err error)
	// Add table to publication, relying on an import manager to schedule the job
	AddTable(context.Context, *SubscriptionPublishedTable) (res *Subscription, err error)
	// Stop a table by removing it from the publication, and expiring any import
	// jobs
	StopTable(context.Context, *SubscriptionPublishedTable) (res *Subscription, err error)
}

Manage a pgsink subscription

type Subscription

type Subscription struct {
	// ID of subscription
	ID string
	// List of published tables
	PublishedTables []*SubscriptionPublishedTable
}

Subscription is the result type of the Subscriptions service Get method.

type SubscriptionPublishedTable

type SubscriptionPublishedTable struct {
	// Postgres table schema
	Schema string
	// Postgres table name
	Name string
}

SubscriptionPublishedTable is the payload type of the Subscriptions service AddTable method.

Jump to

Keyboard shortcuts

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