Documentation
¶
Overview ¶
Package api contains the API server
Index ¶
- Constants
- func AgentWS(state *state.State) http.HandlerFunc
- func EventStream(ctx context.Context, state *state.State) http.HandlerFunc
- func Login(token string) http.HandlerFunc
- func Logout() http.HandlerFunc
- func PublishConfig(state *state.State) http.HandlerFunc
- func PublishEnvs(state *state.State) http.HandlerFunc
- func WithBodyLimit(next http.Handler) http.Handler
- func WithRateLimit(next http.Handler) http.Handler
- func WithSecurityHeaders(next http.Handler) http.Handler
- type Chain
- type Constructor
- type LoginRequest
- type Server
- type UpdateRequest
Constants ¶
View Source
const ( // General per-IP rate limit RPS = 30 Burst = 50 // Body size limit MaxBodySize = 1 << 20 )
Variables ¶
This section is empty.
Functions ¶
func EventStream ¶
func Login ¶
func Login(token string) http.HandlerFunc
func Logout ¶
func Logout() http.HandlerFunc
func PublishConfig ¶
func PublishConfig(state *state.State) http.HandlerFunc
func PublishEnvs ¶
func PublishEnvs(state *state.State) http.HandlerFunc
func WithBodyLimit ¶
WithBodyLimit restricts the size of incoming request bodies.
func WithRateLimit ¶
WithRateLimit creates a simple IP-based rate limiter middleware.
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
func NewChain ¶
func NewChain(constructors ...Constructor) Chain
NewChain creates a new chain for a given list of middleware constructors
type LoginRequest ¶
type LoginRequest struct {
Secret string `json:"secret"`
}
type UpdateRequest ¶ added in v0.1.2
type UpdateRequest struct {
Env string `json:"env"`
Name string `json:"name"`
Config json.RawMessage `json:"config"`
}
Click to show internal directories.
Click to hide internal directories.