apitypes

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Inf = 1<<63 - 1

Variables

This section is empty.

Functions

func UsageByFeature added in v0.3.8

func UsageByFeature(a, b Usage) bool

Types

type Error added in v0.5.0

type Error struct {
	Status  int    `json:"status"`
	Code    string `json:"code"` // (e.g. "invalid_request")
	Message string `json:"message"`
}

func (*Error) Error added in v0.5.0

func (e *Error) Error() string

type Feature added in v0.4.2

type Feature struct {
	Title     string `json:"title,omitempty"`
	Base      int    `json:"base,omitempty"`
	Mode      string `json:"mode,omitempty"`
	Aggregate string `json:"aggregate,omitempty"`
	Tiers     []Tier `json:"tiers,omitempty"`
	PermLink  string `json:"permLink,omitempty"`
}

type Model added in v0.4.2

type Model struct {
	Plans map[refs.Plan]Plan `json:"plans"`
}

type OrgInfo added in v0.6.0

type OrgInfo struct {
	Email       string            `json:"email"`
	Name        string            `json:"name"`
	Description string            `json:"description"`
	Phone       string            `json:"phone"`
	Metadata    map[string]string `json:"metadata"`
}

type Phase

type Phase struct {
	Effective time.Time
	Features  []string
}

type PhaseResponse added in v0.3.8

type PhaseResponse struct {
	Effective time.Time          `json:"effective,omitempty"`
	Features  []refs.FeaturePlan `json:"features,omitempty"`
	Plans     []refs.Plan        `json:"plans,omitempty"`
	Fragments []refs.FeaturePlan `json:"fragments,omitempty"`
}

type Plan added in v0.4.2

type Plan struct {
	Title    string                `json:"title,omitempty"`
	Interval string                `json:"interval,omitempty"`
	Currency string                `json:"currency,omitempty"`
	Features map[refs.Name]Feature `json:"features,omitempty"`
}

type PushResponse added in v0.4.2

type PushResponse struct {
	Results []PushResult `json:"results,omitempty"`
}

type PushResult added in v0.4.2

type PushResult struct {
	Feature refs.FeaturePlan `json:"feature"`
	Status  string           `json:"status"`
	Reason  string           `json:"reason"`
}

type ReportRequest

type ReportRequest struct {
	Org     string
	Feature refs.Name
	N       int
	At      time.Time
	Clobber bool
}

type ScheduleRequest added in v0.6.0

type ScheduleRequest struct {
	Org    string
	Info   *OrgInfo
	Phases []Phase
}

type Tier added in v0.4.2

type Tier struct {
	Upto  int     `json:"upto,omitempty"`
	Price float64 `json:"price,omitempty"`
	Base  int     `json:"base,omitempty"`
}

func (*Tier) MarshalJSON added in v0.4.2

func (t *Tier) MarshalJSON() ([]byte, error)

func (*Tier) UnmarshalJSON added in v0.4.2

func (t *Tier) UnmarshalJSON(data []byte) error

type Usage

type Usage struct {
	Feature refs.Name `json:"feature"`
	Used    int       `json:"used"`
	Limit   int       `json:"limit"`
}

type UsageResponse

type UsageResponse struct {
	Org   string  `json:"org"`
	Usage []Usage `json:"usage"`
}

type WhoAmIResponse added in v0.5.0

type WhoAmIResponse struct {
	ProviderID string    `json:"id"`
	Email      string    `json:"email"`
	Created    time.Time `json:"created"`
	KeySource  string    `json:"key_source"`
	Isolated   bool      `json:"isolated"`
	URL        string    `json:"url"`
}

type WhoIsResponse

type WhoIsResponse struct {
	*OrgInfo
	Org      string `json:"org"`
	StripeID string `json:"stripe_id"`
}

Jump to

Keyboard shortcuts

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