Documentation ¶
Index ¶
Constants ¶
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 ¶
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 ¶
NewAddTableEndpoint returns an endpoint function that calls the method "AddTable" of service "Subscriptions".
func NewGetEndpoint ¶
NewGetEndpoint returns an endpoint function that calls the method "Get" of service "Subscriptions".
func NewStopTableEndpoint ¶
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 (*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 ¶
Endpoints wraps the "Subscriptions" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "Subscriptions" service with 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.