Documentation ¶
Index ¶
- Constants
- type API
- func (a *API) Create(ctx context.Context, subscription FixedSubscription) (int, error)
- func (a *API) Delete(ctx context.Context, id int) error
- func (a *API) Get(ctx context.Context, id int) (*FixedSubscription, error)
- func (a *API) List(ctx context.Context) ([]*FixedSubscription, error)
- func (a *API) Update(ctx context.Context, id int, subscription FixedSubscription) error
- type FixedSubscription
- type HttpClient
- type Log
- type NotFound
- type TaskWaiter
Constants ¶
View Source
const ( // FixedSubscriptionStatusActive is the active value of the `Status` field in `Subscription` FixedSubscriptionStatusActive = "active" // FixedSubscriptionStatusPending is the pending value of the `Status` field in `Subscription` FixedSubscriptionStatusPending = "pending" // FixedSubscriptionStatusError is the error value of the `Status` field in `Subscription` FixedSubscriptionStatusError = "error" // FixedSubscriptionStatusDeleting is the deleting value of the `Status` field in `Subscription` FixedSubscriptionStatusDeleting = "deleting" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func NewAPI ¶
func NewAPI(client HttpClient, taskWaiter TaskWaiter, logger Log) *API
func (*API) Delete ¶
Delete will destroy an existing subscription. All existing databases within the subscription should already be deleted, otherwise this function will fail.
type FixedSubscription ¶
type FixedSubscription struct { ID *int `json:"id,omitempty"` // Omit for Create and Update Name *string `json:"name,omitempty"` Status *string `json:"status,omitempty"` // Omit for Create and Update PlanId *int `json:"planId,omitempty"` PaymentMethodID *int `json:"paymentMethodId,omitempty"` CreationDate *time.Time `json:"creationDate,omitempty"` // Omit for Create and Update }
func (FixedSubscription) String ¶
func (o FixedSubscription) String() string
type HttpClient ¶
type HttpClient interface { Get(ctx context.Context, name, path string, responseBody interface{}) error Post(ctx context.Context, name, path string, requestBody interface{}, responseBody interface{}) error Put(ctx context.Context, name, path string, requestBody interface{}, responseBody interface{}) error Delete(ctx context.Context, name, path string, responseBody interface{}) error }
Click to show internal directories.
Click to hide internal directories.