Documentation
¶
Index ¶
- Constants
- func AlertCmd(ctx context.Context, message *Message, p *Papi, sync bool) error
- func CustomRecoveryWithWriter() gin.HandlerFunc
- func DecisionCmd(ctx context.Context, message *Message, p *Papi, sync bool) error
- func ManagementCmd(ctx context.Context, message *Message, p *Papi, sync bool) error
- func NewAPIC(ctx context.Context, config *csconfig.OnlineApiClientCfg, ...) (*apic, error)
- type APIServer
- func (s *APIServer) AttachPluginBroker(broker *csplugin.PluginBroker)
- func (s *APIServer) Close()
- func (s *APIServer) InitController() error
- func (s *APIServer) InitPlugins(ctx context.Context, cConfig *csconfig.Config, ...) error
- func (s *APIServer) Router() (*gin.Engine, error)
- func (s *APIServer) Run(ctx context.Context, apiReady chan bool) error
- func (s *APIServer) Shutdown(ctx context.Context) error
- type Header
- type Message
- type OperationChannels
- type Papi
- func (p *Papi) GetPermissions(ctx context.Context) (PapiPermCheckSuccess, error)
- func (p *Papi) Pull(ctx context.Context) error
- func (p *Papi) PullOnce(ctx context.Context, since time.Time, sync bool) error
- func (p *Papi) SendDeletedDecisions(ctx context.Context, cacheOrig *models.DecisionsDeleteRequest)
- func (p *Papi) Shutdown()
- func (p *Papi) SyncDecisions(ctx context.Context) error
- type PapiPermCheckError
- type PapiPermCheckSuccess
- type Source
Constants ¶
View Source
const ( PAPIVersion = "v1" PAPIPollURL = "/decisions/stream/poll" PAPIPermissionsURL = "/permissions" SyncInterval = time.Second * 10 PapiPullKey = "papi:last_pull" )
Variables ¶
This section is empty.
Functions ¶
func CustomRecoveryWithWriter ¶ added in v1.0.12
func CustomRecoveryWithWriter() gin.HandlerFunc
CustomRecoveryWithWriter returns a middleware for a writer that recovers from any panics and writes a 500 if there was one.
func DecisionCmd ¶ added in v1.5.0
func ManagementCmd ¶ added in v1.5.0
func NewAPIC ¶
func NewAPIC(ctx context.Context, config *csconfig.OnlineApiClientCfg, dbClient *database.Client, consoleConfig *csconfig.ConsoleConfig, apicWhitelist *csconfig.CapiWhitelist) (*apic, error)
Types ¶
type APIServer ¶
type APIServer struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(ctx context.Context, config *csconfig.LocalApiServerCfg, accessLogger *log.Entry) (*APIServer, error)
NewServer creates a LAPI server. It sets up a gin router, a database client, and a controller.
func (*APIServer) AttachPluginBroker ¶ added in v1.2.0
func (s *APIServer) AttachPluginBroker(broker *csplugin.PluginBroker)
func (*APIServer) InitController ¶ added in v1.2.0
func (*APIServer) InitPlugins ¶ added in v1.6.10
type OperationChannels ¶ added in v1.5.0
type Papi ¶ added in v1.5.0
type Papi struct {
URL string
Client *longpollclient.LongPollClient
DBClient *database.Client
Channels *OperationChannels
SyncInterval time.Duration
Logger *log.Entry
// contains filtered or unexported fields
}
func (*Papi) GetPermissions ¶ added in v1.5.0
func (p *Papi) GetPermissions(ctx context.Context) (PapiPermCheckSuccess, error)
func (*Papi) Pull ¶ added in v1.5.0
Pull is the long polling client for real-time decisions from PAPI
func (*Papi) SendDeletedDecisions ¶ added in v1.5.0
func (p *Papi) SendDeletedDecisions(ctx context.Context, cacheOrig *models.DecisionsDeleteRequest)
type PapiPermCheckError ¶ added in v1.5.0
type PapiPermCheckError struct {
Error string `json:"error"`
}
type PapiPermCheckSuccess ¶ added in v1.5.0
Click to show internal directories.
Click to hide internal directories.