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).
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) 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) 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"`
}
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.