Documentation
¶
Index ¶
- func BuildRefreshPayload(updated *coreauth.Auth) ([]byte, error)
- func SanitizeAuthForDownstream(auth *coreauth.Auth) *coreauth.Auth
- type ClusterAdapter
- type DispatchResult
- type ModelInfo
- type Runtime
- func (r *Runtime) AccessManager() *access.Manager
- func (r *Runtime) AddToken(ctx context.Context, rawJSON string) (string, error)
- func (r *Runtime) ApplyConfigFromCluster(ctx context.Context, cfg *config.Config) error
- func (r *Runtime) Authenticate(ctx context.Context, headers http.Header) (*access.Result, *access.AuthError)
- func (r *Runtime) Config() *config.Config
- func (r *Runtime) ConfigPath() string
- func (r *Runtime) CoreManager() *coreauth.Manager
- func (r *Runtime) Dispatch(ctx context.Context, reqModel string, headers http.Header) (*DispatchResult, error)
- func (r *Runtime) DispatchForAPIKey(ctx context.Context, reqModel string, headers http.Header, apiKey string) (*DispatchResult, error)
- func (r *Runtime) PersistAppLogPayload(ctx context.Context, clientIP string, payload string) (bool, error)
- func (r *Runtime) PersistClusterUsagePayload(ctx context.Context, payload string) (bool, error)
- func (r *Runtime) PublishConfigYAML(payload []byte)
- func (r *Runtime) ReadConfigYAML() ([]byte, error)
- func (r *Runtime) ReadConfigYAMLContext(ctx context.Context) ([]byte, error)
- func (r *Runtime) RecordUsagePayload(ctx context.Context, payload string)
- func (r *Runtime) RefreshClusterAuthIndex(ctx context.Context, uuid string) error
- func (r *Runtime) RefreshNow(ctx context.Context, authIndex string) ([]byte, error)
- func (r *Runtime) RefreshNowLocal(ctx context.Context, authIndex string) ([]byte, error)
- func (r *Runtime) ReloadAuths(ctx context.Context) error
- func (r *Runtime) SetClusterAdapter(adapter ClusterAdapter)
- func (r *Runtime) SetClusterRefreshHandler(handler func(context.Context, string) ([]byte, error))
- func (r *Runtime) Start(ctx context.Context, configPath string) error
- func (r *Runtime) StartAutoRefresh(ctx context.Context)
- func (r *Runtime) Stop()
- func (r *Runtime) StopAutoRefresh()
- func (r *Runtime) SubscribeConfigYAML(subscriber func(payload []byte) error) (unsubscribe func())
- func (r *Runtime) UpdateAuthInMemory(ctx context.Context, auth *coreauth.Auth) (*coreauth.Auth, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildRefreshPayload ¶ added in v1.0.2
BuildRefreshPayload builds a build refresh payload.
Types ¶
type ClusterAdapter ¶ added in v1.0.2
type DispatchResult ¶
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func NewRuntime ¶
NewRuntime creates a new runtime.
func (*Runtime) AccessManager ¶
AccessManager handles an access manager.
func (*Runtime) AddToken ¶
AddToken stores a credential JSON blob into the auth directory and schedules it for use. It returns the created (or existing) auth file name under auth-dir.
func (*Runtime) ApplyConfigFromCluster ¶ added in v1.0.2
ApplyConfigFromCluster updates apply config from cluster.
func (*Runtime) Authenticate ¶
func (r *Runtime) Authenticate(ctx context.Context, headers http.Header) (*access.Result, *access.AuthError)
Authenticate validates request credentials and returns the access result.
func (*Runtime) ConfigPath ¶
ConfigPath handles a config path.
func (*Runtime) CoreManager ¶
CoreManager handles a core manager.
func (*Runtime) Dispatch ¶
func (r *Runtime) Dispatch(ctx context.Context, reqModel string, headers http.Header) (*DispatchResult, error)
Dispatch processes dispatch.
func (*Runtime) DispatchForAPIKey ¶ added in v1.0.20
func (r *Runtime) DispatchForAPIKey(ctx context.Context, reqModel string, headers http.Header, apiKey string) (*DispatchResult, error)
DispatchForAPIKey processes dispatch with API-key channel restrictions.
func (*Runtime) PersistAppLogPayload ¶ added in v1.0.25
func (r *Runtime) PersistAppLogPayload(ctx context.Context, clientIP string, payload string) (bool, error)
PersistAppLogPayload stores a CPA app log payload in the runtime database.
func (*Runtime) PersistClusterUsagePayload ¶ added in v1.0.2
PersistClusterUsagePayload stores persist cluster usage payload.
func (*Runtime) PublishConfigYAML ¶
PublishConfigYAML handles a publish config yaml.
func (*Runtime) ReadConfigYAML ¶
ReadConfigYAML loads read config yaml.
func (*Runtime) ReadConfigYAMLContext ¶ added in v1.0.2
ReadConfigYAMLContext loads read config yaml context.
func (*Runtime) RecordUsagePayload ¶
RecordUsagePayload applies downstream usage status to the scheduler auth state.
func (*Runtime) RefreshClusterAuthIndex ¶ added in v1.0.2
RefreshClusterAuthIndex refreshes refresh cluster auth index.
func (*Runtime) RefreshNow ¶ added in v1.0.2
RefreshNow refreshes refresh now.
func (*Runtime) RefreshNowLocal ¶ added in v1.0.2
RefreshNowLocal refreshes refresh now local.
func (*Runtime) ReloadAuths ¶ added in v1.0.2
ReloadAuths handles a reload auths.
func (*Runtime) SetClusterAdapter ¶ added in v1.0.2
func (r *Runtime) SetClusterAdapter(adapter ClusterAdapter)
SetClusterAdapter sets a cluster adapter.
func (*Runtime) SetClusterRefreshHandler ¶ added in v1.0.2
SetClusterRefreshHandler sets a cluster refresh handler.
func (*Runtime) StartAutoRefresh ¶ added in v1.0.2
StartAutoRefresh starts an auto refresh.
func (*Runtime) StopAutoRefresh ¶ added in v1.0.2
func (r *Runtime) StopAutoRefresh()
StopAutoRefresh stops an auto refresh.
func (*Runtime) SubscribeConfigYAML ¶
SubscribeConfigYAML handles a subscribe config yaml.