subscription

package
v0.0.0-...-081ecb4 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Overview

Code generated by genservices. DO NOT EDIT.

Code generated by genservices. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(svc Service, r *mux.Router, regCtx *endpointutil.HandlerRegContext)

Types

type BasicService

type BasicService struct {
	// contains filtered or unexported fields
}

func NewBasicService

func NewBasicService(orgPolicy *policy.Organization, cfg config.Config,
	update *subs.UpdaterProducer, pec *paymentevents.CreatorProducer) *BasicService

func (BasicService) EventCreate

func (s BasicService) EventCreate(rc *request.AnonymousContext, context *EventRequestContext, body request.Body) error

func (BasicService) Get

Find existing subscription for the organization and return it in "subscription" field (if subscription exists). If no subscription return trial duration: defend from always recreating subscription with the trial: select created_at of first created subscription and get trial duration as (config.getTrialDuration() - (now() - first_subscription.created_at).

func (BasicService) Update

func (s BasicService) Update(rc *request.AuthorizedContext, reqOrg *request.Org, payload *UpdatePayload) error

type EventCreateRequest

type EventCreateRequest struct {
	Context *EventRequestContext
	Body    request.Body
}

type EventCreateResponse

type EventCreateResponse struct {
	// contains filtered or unexported fields
}

type EventRequestContext

type EventRequestContext struct {
	Provider string `request:"provider,urlPart,"`
	Token    string `request:"token,urlPart,"`
}

func (EventRequestContext) FillLogContext

func (r EventRequestContext) FillLogContext(lctx logutil.Context)

type GetRequest

type GetRequest struct {
	ReqOrg *request.Org
}

type GetResponse

type GetResponse struct {
	*returntypes.SubInfo
	// contains filtered or unexported fields
}

type Service

type Service interface {
	//url:/v1/orgs/{provider}/{name}/subscription
	Get(rc *request.AuthorizedContext, reqOrg *request.Org) (*returntypes.SubInfo, error)

	//url:/v1/orgs/{provider}/{name}/subscription method:PUT
	Update(rc *request.AuthorizedContext, reqOrg *request.Org, payload *UpdatePayload) error

	//url:/v1/payments/{provider}/{token}/events method:POST
	EventCreate(rc *request.AnonymousContext, context *EventRequestContext, body request.Body) error
}

type UpdatePayload

type UpdatePayload struct {
	SeatsCount int `json:"seatsCount"`
	OrgVersion int `json:"orgVersion"`
	Version    int `json:"version"`
}

func (UpdatePayload) FillLogContext

func (p UpdatePayload) FillLogContext(lctx logutil.Context)

type UpdateRequest

type UpdateRequest struct {
	ReqOrg  *request.Org
	Payload *UpdatePayload
}

type UpdateResponse

type UpdateResponse struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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