Documentation
¶
Overview ¶
Package edition decides which features the configured product edition (app.edition) serves. The commercial packages and routes are listed once, in config/editions.json; the community edition answers their /api/v2 routes exactly as it answers a route that is not declared, and its release leaves the packages out (packages/shared/build_package.py). The commercial API prefixes reserve parts of a package's v4 API for the commercial edition (forward-sdk.md section 12: the forward package's user self-service, plans and multipliers, v4.3): the community edition answers a request under one as a route that does not exist.
Index ¶
- type Policy
- func (p *Policy) Commercial() bool
- func (p *Policy) HiddenPackages() []string
- func (p *Policy) HiddenRoutes() []string
- func (p *Policy) Hides(packageID, routeID string) bool
- func (p *Policy) HidesPackage(packageID string) bool
- func (p *Policy) HidesPath(requestPath string) bool
- func (p *Policy) HidesRequest(method, fullPath string) bool
- func (p *Policy) Name() string
- type Route
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Policy ¶
type Policy struct {
// contains filtered or unexported fields
}
Policy answers what one edition serves.
func (*Policy) Commercial ¶
Commercial reports whether this is the commercial edition.
func (*Policy) HiddenPackages ¶
HiddenPackages lists the packages the edition hides, sorted.
func (*Policy) HiddenRoutes ¶
HiddenRoutes lists the /api/v2 routes ("METHOD path") the edition hides, sorted.
func (*Policy) HidesPackage ¶
HidesPackage reports whether the edition hides a whole package.
func (*Policy) HidesPath ¶ added in v4.2.0
HidesPath reports whether the edition hides an /api/v4/ request path: one under a commercial API prefix, or the prefix itself without its slash.
func (*Policy) HidesRequest ¶
HidesRequest reports whether the edition hides the /api/v2 route that a request matched: method and the gin route pattern (gin.Context.FullPath).
type Table ¶
type Table struct {
Format string `json:"format"`
Default string `json:"default"`
CommercialPackages []string `json:"commercial_packages"`
CommercialRoutes []string `json:"commercial_routes"`
// CommercialAPIPrefixes are /api/v4/ path prefixes, each ending in "/",
// that only the commercial edition serves.
CommercialAPIPrefixes []string `json:"commercial_api_prefixes"`
}
Table is config/editions.json.
func Commercial ¶
func Commercial() Table
Commercial returns config/editions.json. It panics when the embedded table is invalid, which TestEmbeddedTablesAreValid catches.