Documentation
¶
Index ¶
- Constants
- func ContextWithParams(ctx context.Context, params Params) context.Context
- type ApiBackend
- type ApiConfig
- type ApiOption
- type Backend
- type Client
- func (c *Client) AccessTokenCreate(ctx context.Context, params *atomic.AccessTokenCreateInput) (*atomic.AccessToken, error)
- func (c *Client) AccessTokenGet(ctx context.Context, params *atomic.AccessTokenGetInput) (*atomic.AccessToken, error)
- func (c *Client) AccessTokenRevoke(ctx context.Context, params *atomic.AccessTokenRevokeInput) error
- func (c *Client) ApplicationCreate(ctx context.Context, params *atomic.ApplicationCreateInput) (*atomic.Application, error)
- func (c *Client) ApplicationDelete(ctx context.Context, params *atomic.ApplicationDeleteInput) error
- func (c *Client) ApplicationGet(ctx context.Context, params *atomic.ApplicationGetInput) (*atomic.Application, error)
- func (c *Client) ApplicationList(ctx context.Context, params *atomic.ApplicationListInput) ([]*atomic.Application, error)
- func (c *Client) ApplicationUpdate(ctx context.Context, params *atomic.ApplicationUpdateInput) (*atomic.Application, error)
- func (c *Client) ArticleCreate(ctx context.Context, params *atomic.ArticleCreateInput) (*atomic.Article, error)
- func (c *Client) ArticleDelete(ctx context.Context, params *atomic.ArticleDeleteInput) error
- func (c *Client) ArticleGet(ctx context.Context, params *atomic.ArticleGetInput) (*atomic.Article, error)
- func (c *Client) ArticleList(ctx context.Context, params *atomic.ArticleListInput) ([]*atomic.Article, error)
- func (c *Client) ArticleUpdate(ctx context.Context, params *atomic.ArticleUpdateInput) (*atomic.Article, error)
- func (c *Client) AssetCreate(ctx context.Context, params *atomic.AssetCreateInput) (*atomic.Asset, error)
- func (c *Client) AssetDelete(ctx context.Context, params *atomic.AssetDeleteInput) error
- func (c *Client) AssetGet(ctx context.Context, params *atomic.AssetGetInput) (*atomic.Asset, error)
- func (c *Client) AssetList(ctx context.Context, params *atomic.AssetListInput) ([]*atomic.Asset, error)
- func (c *Client) AssetUpdate(ctx context.Context, params *atomic.AssetUpdateInput) (*atomic.Asset, error)
- func (c *Client) AudienceCreate(ctx context.Context, params *atomic.AudienceCreateInput) (*atomic.Audience, error)
- func (c *Client) AudienceDelete(ctx context.Context, params *atomic.AudienceDeleteInput) error
- func (c *Client) AudienceGet(ctx context.Context, params *atomic.AudienceGetInput) (*atomic.Audience, error)
- func (c *Client) AudienceList(ctx context.Context, params *atomic.AudienceListInput) ([]*atomic.Audience, error)
- func (c *Client) AudienceUpdate(ctx context.Context, params *atomic.AudienceUpdateInput) (*atomic.Audience, error)
- func (c *Client) DistributionCreate(ctx context.Context, params *atomic.DistributionCreateInput) (*atomic.Distribution, error)
- func (c *Client) DistributionDelete(ctx context.Context, params *atomic.DistributionDeleteInput) error
- func (c *Client) DistributionGet(ctx context.Context, params *atomic.DistributionGetInput) (*atomic.Distribution, error)
- func (c *Client) DistributionList(ctx context.Context, params *atomic.DistributionListInput) ([]*atomic.Distribution, error)
- func (c *Client) DistributionUpdate(ctx context.Context, params *atomic.DistributionUpdateInput) (*atomic.Distribution, error)
- func (c *Client) InstanceCreate(ctx context.Context, params *atomic.InstanceCreateInput) (*atomic.Instance, error)
- func (c *Client) InstanceDelete(ctx context.Context, params *atomic.InstanceDeleteInput) error
- func (c *Client) InstanceGet(ctx context.Context, params *atomic.InstanceGetInput) (*atomic.Instance, error)
- func (c *Client) InstanceList(ctx context.Context, params *atomic.InstanceListInput) ([]*atomic.Instance, error)
- func (c *Client) InstanceUpdate(ctx context.Context, params *atomic.InstanceUpdateInput) (*atomic.Instance, error)
- func (c *Client) OptionGet(ctx context.Context, params *atomic.OptionGetInput) (*atomic.Option, error)
- func (c *Client) OptionList(ctx context.Context, params *atomic.OptionListInput) ([]*atomic.Option, error)
- func (c *Client) OptionRemove(ctx context.Context, params *atomic.OptionRemoveInput) error
- func (c *Client) OptionUpdate(ctx context.Context, params *atomic.OptionUpdateInput) (*atomic.Option, error)
- func (c *Client) PlanCreate(ctx context.Context, params *atomic.PlanCreateInput) (*atomic.Plan, error)
- func (c *Client) PlanDelete(ctx context.Context, params *atomic.PlanDeleteInput) error
- func (c *Client) PlanGet(ctx context.Context, params *atomic.PlanGetInput) (*atomic.Plan, error)
- func (c *Client) PlanList(ctx context.Context, params *atomic.PlanListInput) ([]*atomic.Plan, error)
- func (c *Client) PlanSubscribe(ctx context.Context, params *atomic.PlanSubscribeInput) (*atomic.Subscription, error)
- func (c *Client) PlanUpdate(ctx context.Context, params *atomic.PlanUpdateInput) (*atomic.Plan, error)
- func (c *Client) PriceCreate(ctx context.Context, params *atomic.PriceCreateInput) (*atomic.Price, error)
- func (c *Client) PriceDelete(ctx context.Context, params *atomic.PriceDeleteInput) error
- func (c *Client) PriceGet(ctx context.Context, params *atomic.PriceGetInput) (*atomic.Price, error)
- func (c *Client) PriceList(ctx context.Context, params *atomic.PriceListInput) ([]*atomic.Price, error)
- func (c *Client) PriceUpdate(ctx context.Context, params *atomic.PriceUpdateInput) (*atomic.Price, error)
- func (c *Client) PublisherCreate(ctx context.Context, params *atomic.PublisherCreateInput) (*atomic.Publisher, error)
- func (c *Client) PublisherDelete(ctx context.Context, params *atomic.PublisherDeleteInput) error
- func (c *Client) PublisherGet(ctx context.Context, params *atomic.PublisherGetInput) (*atomic.Publisher, error)
- func (c *Client) PublisherList(ctx context.Context, params *atomic.PublisherListInput) (*atomic.PublisherListOutput, error)
- func (c *Client) PublisherUpdate(ctx context.Context, params *atomic.PublisherUpdateInput) (*atomic.Publisher, error)
- func (c *Client) SendMail(ctx context.Context, params *atomic.SendMailInput) ([]*email.Message, error)
- func (c *Client) SendSMS(ctx context.Context, params *atomic.SendSMSInput) ([]*atomic.SMS, error)
- func (c *Client) SubscriptionCreate(ctx context.Context, params *atomic.SubscriptionCreateInput) (*atomic.Subscription, error)
- func (c *Client) SubscriptionDelete(ctx context.Context, params *atomic.SubscriptionDeleteInput) error
- func (c *Client) SubscriptionGet(ctx context.Context, params *atomic.SubscriptionGetInput) (*atomic.Subscription, error)
- func (c *Client) SubscriptionList(ctx context.Context, params *atomic.SubscriptionListInput) ([]*atomic.Subscription, error)
- func (c *Client) SubscriptionUpdate(ctx context.Context, params *atomic.SubscriptionUpdateInput) (*atomic.Subscription, error)
- func (c *Client) TemplateCreate(ctx context.Context, params *atomic.TemplateCreateInput) (*atomic.Template, error)
- func (c *Client) TemplateDelete(ctx context.Context, params *atomic.TemplateDeleteInput) error
- func (c *Client) TemplateGet(ctx context.Context, params *atomic.TemplateGetInput) (*atomic.Template, error)
- func (c *Client) TemplateList(ctx context.Context, params *atomic.TemplateListInput) ([]*atomic.Template, error)
- func (c *Client) TemplateUpdate(ctx context.Context, params *atomic.TemplateUpdateInput) (*atomic.Template, error)
- func (c *Client) UserCreate(ctx context.Context, params *atomic.UserCreateInput) (*atomic.User, error)
- func (c *Client) UserDelete(ctx context.Context, params *atomic.UserDeleteInput) error
- func (c *Client) UserGet(ctx context.Context, params *atomic.UserGetInput) (*atomic.User, error)
- func (c *Client) UserImport(ctx context.Context, params *atomic.UserImportInput) (*atomic.Job, error)
- func (c *Client) UserList(ctx context.Context, params *atomic.UserListInput) ([]*atomic.User, error)
- func (c *Client) UserUpdate(ctx context.Context, params *atomic.UserUpdateInput) (*atomic.User, error)
- type ClientParamsKey
- type Error
- type Iter
- type ListParams
- type NextFunc
- type Params
- type ParamsEncoding
- type RequestContainer
- type RequestProxy
- func (p *RequestProxy[T]) Body() io.Reader
- func (p *RequestProxy[T]) ContentType() string
- func (p *RequestProxy[T]) Delete() *RequestProxy[T]
- func (p *RequestProxy[T]) Get() *RequestProxy[T]
- func (p *RequestProxy[T]) MarshalJSON() ([]byte, error)
- func (p *RequestProxy[T]) Method() string
- func (p *RequestProxy[T]) MethodParams() validation.Validatable
- func (p *RequestProxy[T]) ParamsEncoding() ParamsEncoding
- func (p *RequestProxy[T]) Patch() *RequestProxy[T]
- func (p *RequestProxy[T]) Path() string
- func (p *RequestProxy[T]) Post() *RequestProxy[T]
- func (p *RequestProxy[T]) Put() *RequestProxy[T]
- func (p *RequestProxy[T]) RequestParams() Params
- func (p *RequestProxy[T]) WithBody(body io.Reader) *RequestProxy[T]
- func (p *RequestProxy[T]) WithContentType(contentType string) *RequestProxy[T]
- func (p *RequestProxy[T]) WithEncoding(encoding ParamsEncoding) *RequestProxy[T]
- func (p *RequestProxy[T]) WithMethod(method string) *RequestProxy[T]
- type Resource
- type Responder
- type Response
- type ResponseProxy
- type ResponseSliceProxy
Constants ¶
View Source
const ( UserTokenCreatePath = "/api/1.0.0/users/%s/tokens" AppTokenCreatePath = "/api/1.0.0/applications/%s/tokens" AccessTokenGetPath = "/api/1.0.0/tokens/%s" AccessTokenRevokePath = "/api/1.0.0/tokens/%s" AccessTokenDeletePath = "/api/1.0.0/tokens/%s" )
View Source
const ( ApplicationGetPath = "/api/1.0.0/applications/%s" ApplicationCreatePath = "/api/1.0.0/applications" ApplicationUpdatePath = "/api/1.0.0/applications/%s" ApplicationDeletePath = "/api/1.0.0/applications/%s" ApplicationListPath = "/api/1.0.0/applications" )
View Source
const ( ArticleCreatePath = "/api/1.0.0/articles" ArticleUpdatePath = "/api/1.0.0/articles/%s" ArticleDeletePath = "/api/1.0.0/articles/%s" ArticleListPath = "/api/1.0.0/articles" ArticleGetPath = "/api/1.0.0/articles/%s" )
View Source
const ( AssetCreatePath = "/api/1.0.0/assets" AssetGetPath = "/api/1.0.0/assets/%s" AssetUpdatePath = "/api/1.0.0/assets/%s" AssetDeletePath = "/api/1.0.0/assets/%s" AssetListPath = "/api/1.0.0/assets" )
View Source
const ( AudienceGetPath = "/api/1.0.0/audiences/%s" AudienceCreatePath = "/api/1.0.0/audiences" AudienceUpdatePath = "/api/1.0.0/audiences/%s" AudienceDeletePath = "/api/1.0.0/audiences/%s" AudienceListPath = "/api/1.0.0/audiences" )
View Source
const ( DistributionGetPath = "/api/1.0.0/distributions/%s" DistributionCreatePath = "/api/1.0.0/distributions" DistributionUpdatePath = "/api/1.0.0/distributions/%s" DistributionDeletePath = "/api/1.0.0/distributions/%s" DistributionListPath = "/api/1.0.0/distributions" )
View Source
const ( InstanceCreatePath = "/api/1.0.0/instances" InstanceGetPath = "/api/1.0.0/instances/%s" InstanceListPath = "/api/1.0.0/instances" InstanceUpdatePath = "/api/1.0.0/instances/%s" InstanceDeletePath = "/api/1.0.0/instances/%s" )
View Source
const ( OptionGetPath = "/api/1.0.0/options/%s" OptionListPath = "/api/1.0.0/options" OptionUpdatePath = "/api/1.0.0/options/%s" OptionRemovePath = "/api/1.0.0/options/%s" )
View Source
const ( PlanGetPath = "/api/1.0.0/plans/%s" PlanCreatePath = "/api/1.0.0/plans" PlanUpdatePath = "/api/1.0.0/plans/%s" PlanDeletePath = "/api/1.0.0/plans/%s" PlanListPath = "/api/1.0.0/plans" PlanSubscribePath = "/api/1.0.0/plans/%s/subscribe" )
View Source
const ( PriceGetPath = "/api/1.0.0/prices/%s" PriceCreatePath = "/api/1.0.0/prices" PriceUpdatePath = "/api/1.0.0/prices/%s" PriceDeletePath = "/api/1.0.0/prices/%s" PriceListPath = "/api/1.0.0/prices" )
View Source
const ( PublisherCreatePath = "/api/1.0.0/publishers" PublisherUpdatePath = "/api/1.0.0/publishers/%s" PublisherGetPath = "/api/1.0.0/publishers/%s" PublisherListPath = "/api/1.0.0/publishers" PublisherDeletePath = "/api/1.0.0/publishers/%s" )
View Source
const ( SubscriptionGetPath = "/api/1.0.0/subscriptions/%s" SubscriptionListPath = "/api/1.0.0/subscriptions" SubscriptionCreatePath = "/api/1.0.0/subscriptions" SubscriptionUpdatePath = "/api/1.0.0/subscriptions/%s" SubscriptionDeletePath = "/api/1.0.0/subscriptions/%s" )
View Source
const ( TemplateGetPath = "/api/1.0.0/templates/%s" TemplateListPath = "/api/1.0.0/templates" TemplateCreatePath = "/api/1.0.0/templates" TemplateUpdatePath = "/api/1.0.0/templates/%s" TemplateDeletePath = "/api/1.0.0/templates/%s" )
View Source
const ( UserGetPath = "/api/1.0.0/users/%s" UserCreatePath = "/api/1.0.0/users" UserUpdatePath = "/api/1.0.0/users/%s" UserDeletePath = "/api/1.0.0/users/%s" UserListPath = "/api/1.0.0/users" UserImportPath = "/api/1.0.0/users/import" )
View Source
const (
DefaultAPIHost = "localhost:9000"
)
View Source
const (
SMSSendPath = "/api/1.0.0/sms"
)
View Source
const (
SendMailPath = "/api/1.0.0/mail"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ApiBackend ¶
type ApiBackend struct {
// contains filtered or unexported fields
}
func (*ApiBackend) ExecContext ¶
func (b *ApiBackend) ExecContext(ctx context.Context, params RequestContainer, result Responder) error
func (*ApiBackend) NewRequest ¶
func (b *ApiBackend) NewRequest(ctx context.Context, params RequestContainer) (*http.Request, error)
type Backend ¶
type Backend interface {
ExecContext(ctx context.Context, params RequestContainer, result Responder) error
}
type Client ¶
type Client struct {
Backend Backend
}
func (*Client) AccessTokenCreate ¶
func (c *Client) AccessTokenCreate(ctx context.Context, params *atomic.AccessTokenCreateInput) (*atomic.AccessToken, error)
func (*Client) AccessTokenGet ¶
func (c *Client) AccessTokenGet(ctx context.Context, params *atomic.AccessTokenGetInput) (*atomic.AccessToken, error)
func (*Client) AccessTokenRevoke ¶
func (*Client) ApplicationCreate ¶
func (c *Client) ApplicationCreate(ctx context.Context, params *atomic.ApplicationCreateInput) (*atomic.Application, error)
func (*Client) ApplicationDelete ¶
func (*Client) ApplicationGet ¶
func (c *Client) ApplicationGet(ctx context.Context, params *atomic.ApplicationGetInput) (*atomic.Application, error)
func (*Client) ApplicationList ¶
func (c *Client) ApplicationList(ctx context.Context, params *atomic.ApplicationListInput) ([]*atomic.Application, error)
func (*Client) ApplicationUpdate ¶
func (c *Client) ApplicationUpdate(ctx context.Context, params *atomic.ApplicationUpdateInput) (*atomic.Application, error)
func (*Client) ArticleCreate ¶
func (*Client) ArticleDelete ¶
func (*Client) ArticleGet ¶
func (*Client) ArticleList ¶
func (*Client) ArticleUpdate ¶
func (*Client) AssetCreate ¶
func (*Client) AssetDelete ¶
func (*Client) AssetUpdate ¶
func (*Client) AudienceCreate ¶
func (*Client) AudienceDelete ¶
func (*Client) AudienceGet ¶
func (*Client) AudienceList ¶
func (*Client) AudienceUpdate ¶
func (*Client) DistributionCreate ¶
func (c *Client) DistributionCreate(ctx context.Context, params *atomic.DistributionCreateInput) (*atomic.Distribution, error)
func (*Client) DistributionDelete ¶
func (*Client) DistributionGet ¶
func (c *Client) DistributionGet(ctx context.Context, params *atomic.DistributionGetInput) (*atomic.Distribution, error)
func (*Client) DistributionList ¶
func (c *Client) DistributionList(ctx context.Context, params *atomic.DistributionListInput) ([]*atomic.Distribution, error)
func (*Client) DistributionUpdate ¶
func (c *Client) DistributionUpdate(ctx context.Context, params *atomic.DistributionUpdateInput) (*atomic.Distribution, error)
func (*Client) InstanceCreate ¶
func (*Client) InstanceDelete ¶
func (*Client) InstanceGet ¶
func (*Client) InstanceList ¶
func (*Client) InstanceUpdate ¶
func (*Client) OptionList ¶
func (*Client) OptionRemove ¶
func (*Client) OptionUpdate ¶
func (*Client) PlanCreate ¶
func (*Client) PlanDelete ¶
func (*Client) PlanSubscribe ¶
func (c *Client) PlanSubscribe(ctx context.Context, params *atomic.PlanSubscribeInput) (*atomic.Subscription, error)
func (*Client) PlanUpdate ¶
func (*Client) PriceCreate ¶
func (*Client) PriceDelete ¶
func (*Client) PriceUpdate ¶
func (*Client) PublisherCreate ¶
func (*Client) PublisherDelete ¶
func (*Client) PublisherGet ¶
func (*Client) PublisherList ¶
func (c *Client) PublisherList(ctx context.Context, params *atomic.PublisherListInput) (*atomic.PublisherListOutput, error)
func (*Client) PublisherUpdate ¶
func (*Client) SubscriptionCreate ¶
func (c *Client) SubscriptionCreate(ctx context.Context, params *atomic.SubscriptionCreateInput) (*atomic.Subscription, error)
func (*Client) SubscriptionDelete ¶
func (*Client) SubscriptionGet ¶
func (c *Client) SubscriptionGet(ctx context.Context, params *atomic.SubscriptionGetInput) (*atomic.Subscription, error)
func (*Client) SubscriptionList ¶
func (c *Client) SubscriptionList(ctx context.Context, params *atomic.SubscriptionListInput) ([]*atomic.Subscription, error)
func (*Client) SubscriptionUpdate ¶
func (c *Client) SubscriptionUpdate(ctx context.Context, params *atomic.SubscriptionUpdateInput) (*atomic.Subscription, error)
func (*Client) TemplateCreate ¶
func (*Client) TemplateDelete ¶
func (*Client) TemplateGet ¶
func (*Client) TemplateList ¶
func (*Client) TemplateUpdate ¶
func (*Client) UserCreate ¶
func (*Client) UserDelete ¶
func (*Client) UserImport ¶
func (*Client) UserUpdate ¶
type ClientParamsKey ¶
type ClientParamsKey string
type ListParams ¶
type Params ¶
type Params struct { Context context.Context `schema:"-" json:"-"` Headers http.Header `schema:"-" json:"-"` NoAuth bool `schema:"-" json:"-"` Expand []string `schema:"expand,omitempty" json:"expand,omitempty"` Fields []string `schema:"fields,omitempty" json:"fields,omitempty"` Instance *string `schema:"instance,omitempty" json:"-"` }
func ParamsFromContext ¶
type ParamsEncoding ¶
type ParamsEncoding string
const ( ParamsEncodingJSON ParamsEncoding = "json" ParamsEncodingMultipart ParamsEncoding = "multipart" ParamsEncodingQuery ParamsEncoding = "query" )
type RequestContainer ¶
type RequestContainer interface { MethodParams() validation.Validatable RequestParams() Params ParamsEncoding() ParamsEncoding ContentType() string Method() string Path() string Body() io.Reader }
type RequestProxy ¶
type RequestProxy[T validation.Validatable] struct { // contains filtered or unexported fields }
func NewRequest ¶
func NewRequest[T validation.Validatable](ctx context.Context, path string, methodParams T) *RequestProxy[T]
func (*RequestProxy[T]) Body ¶
func (p *RequestProxy[T]) Body() io.Reader
func (*RequestProxy[T]) ContentType ¶
func (p *RequestProxy[T]) ContentType() string
func (*RequestProxy[T]) Delete ¶
func (p *RequestProxy[T]) Delete() *RequestProxy[T]
func (*RequestProxy[T]) Get ¶
func (p *RequestProxy[T]) Get() *RequestProxy[T]
func (*RequestProxy[T]) MarshalJSON ¶
func (p *RequestProxy[T]) MarshalJSON() ([]byte, error)
func (*RequestProxy[T]) Method ¶
func (p *RequestProxy[T]) Method() string
func (*RequestProxy[T]) MethodParams ¶
func (p *RequestProxy[T]) MethodParams() validation.Validatable
func (*RequestProxy[T]) ParamsEncoding ¶
func (p *RequestProxy[T]) ParamsEncoding() ParamsEncoding
func (*RequestProxy[T]) Patch ¶
func (p *RequestProxy[T]) Patch() *RequestProxy[T]
func (*RequestProxy[T]) Path ¶
func (p *RequestProxy[T]) Path() string
func (*RequestProxy[T]) Post ¶
func (p *RequestProxy[T]) Post() *RequestProxy[T]
func (*RequestProxy[T]) Put ¶
func (p *RequestProxy[T]) Put() *RequestProxy[T]
func (*RequestProxy[T]) RequestParams ¶
func (p *RequestProxy[T]) RequestParams() Params
func (*RequestProxy[T]) WithBody ¶
func (p *RequestProxy[T]) WithBody(body io.Reader) *RequestProxy[T]
func (*RequestProxy[T]) WithContentType ¶
func (p *RequestProxy[T]) WithContentType(contentType string) *RequestProxy[T]
func (*RequestProxy[T]) WithEncoding ¶
func (p *RequestProxy[T]) WithEncoding(encoding ParamsEncoding) *RequestProxy[T]
func (*RequestProxy[T]) WithMethod ¶
func (p *RequestProxy[T]) WithMethod(method string) *RequestProxy[T]
type Resource ¶
type Resource[T any] struct { LastResponse *Response `json:"-"` // contains filtered or unexported fields }
func (*Resource[T]) SetLastResponse ¶
type ResponseProxy ¶
type ResponseSliceProxy ¶
Click to show internal directories.
Click to hide internal directories.