Documentation
¶
Index ¶
- func TriggerAdaptation(ac *AdaptationConfig)
- func TriggerUserAdaptation(wg *sync.WaitGroup, ac *AdaptationConfig, userId uint64)
- type AdaptationConfig
- type AdaptationResult
- type AdaptationService
- type AdaptationStatus
- type AdaptationType
- type ClientConfig
- type DummyAdaptationService
- type Server
- func (srv *Server) AdaptationHandler(w http.ResponseWriter, r *http.Request)
- func (srv *Server) AdaptationStatusHandler(w http.ResponseWriter, r *http.Request)
- func (srv *Server) PullMessagesHandler(w http.ResponseWriter, r *http.Request)
- func (srv *Server) RegisterAdaptationService(as AdaptationService)
- func (srv *Server) Start() error
- func (srv *Server) SubscriptionHandler(w http.ResponseWriter, r *http.Request)
- func (srv *Server) SubscriptionRefreshHandler(w http.ResponseWriter, r *http.Request)
- func (srv *Server) UnsubscriptionHandler(w http.ResponseWriter, r *http.Request)
- func (srv *Server) UpdateHandler(w http.ResponseWriter, r *http.Request)
- func (srv *Server) UserAdaptationHandler(w http.ResponseWriter, r *http.Request)
- func (srv *Server) UserAdaptationStatusHandler(w http.ResponseWriter, r *http.Request)
- type ServerMetrics
- type Subscription
- type SubscriptionRequest
- type Topic
- type TopicMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TriggerAdaptation ¶
func TriggerAdaptation(ac *AdaptationConfig)
func TriggerUserAdaptation ¶
func TriggerUserAdaptation(wg *sync.WaitGroup, ac *AdaptationConfig, userId uint64)
Types ¶
type AdaptationConfig ¶
type AdaptationConfig struct { Scheme AdaptationType `json:"scheme"` CompletionURL string `json:"completionUrl"` // contains filtered or unexported fields }
func (*AdaptationConfig) UnmarshalJSON ¶
func (ac *AdaptationConfig) UnmarshalJSON(data []byte) error
type AdaptationResult ¶
type AdaptationService ¶
type AdaptationStatus ¶
type AdaptationStatus struct { DriverID uint64 `json:"driverId,omitempty"` Scheme AdaptationType `json:"scheme"` Since string `json:"since"` }
type AdaptationType ¶
type AdaptationType string
const ( None AdaptationType = "None" BlockSensitiveStoring AdaptationType = "BlockSensitiveStoring" CountryRedirection AdaptationType = "CountryRedirection" EdgePushDown AdaptationType = "EdgePushDown" )
func (AdaptationType) Int ¶
func (a AdaptationType) Int() int
func (AdaptationType) String ¶
func (a AdaptationType) String() string
type ClientConfig ¶
type ClientConfig struct { Host string Port int APIKey string Timeout time.Duration PollInterval time.Duration }
func DefaultClientConfig ¶
func DefaultClientConfig() *ClientConfig
func (*ClientConfig) Receive ¶
func (c *ClientConfig) Receive(ctx context.Context, sub *Subscription) []byte
func (*ClientConfig) Subscribe ¶
func (c *ClientConfig) Subscribe(req *SubscriptionRequest) (*Subscription, error)
func (*ClientConfig) Unsubscribe ¶
func (c *ClientConfig) Unsubscribe(sub *Subscription)
type DummyAdaptationService ¶
type DummyAdaptationService struct{}
func (DummyAdaptationService) BlockSensitiveStoring ¶
func (s DummyAdaptationService) BlockSensitiveStoring(userId uint64) error
func (DummyAdaptationService) CountryRedirection ¶
func (s DummyAdaptationService) CountryRedirection(userId uint64) error
func (DummyAdaptationService) EdgePushDown ¶
func (s DummyAdaptationService) EdgePushDown(userId uint64) error
func (DummyAdaptationService) None ¶
func (s DummyAdaptationService) None(userId uint64) error
type Server ¶
func (*Server) AdaptationHandler ¶
func (srv *Server) AdaptationHandler(w http.ResponseWriter, r *http.Request)
func (*Server) AdaptationStatusHandler ¶
func (srv *Server) AdaptationStatusHandler(w http.ResponseWriter, r *http.Request)
func (*Server) PullMessagesHandler ¶
func (srv *Server) PullMessagesHandler(w http.ResponseWriter, r *http.Request)
func (*Server) RegisterAdaptationService ¶
func (srv *Server) RegisterAdaptationService(as AdaptationService)
func (*Server) SubscriptionHandler ¶
func (srv *Server) SubscriptionHandler(w http.ResponseWriter, r *http.Request)
func (*Server) SubscriptionRefreshHandler ¶
func (srv *Server) SubscriptionRefreshHandler(w http.ResponseWriter, r *http.Request)
func (*Server) UnsubscriptionHandler ¶
func (srv *Server) UnsubscriptionHandler(w http.ResponseWriter, r *http.Request)
func (*Server) UpdateHandler ¶
func (srv *Server) UpdateHandler(w http.ResponseWriter, r *http.Request)
func (*Server) UserAdaptationHandler ¶
func (srv *Server) UserAdaptationHandler(w http.ResponseWriter, r *http.Request)
func (*Server) UserAdaptationStatusHandler ¶
func (srv *Server) UserAdaptationStatusHandler(w http.ResponseWriter, r *http.Request)
type ServerMetrics ¶
type ServerMetrics struct { Adaptations prometheus.Counter SystemAdaptations prometheus.Counter UserAdaptations prometheus.Counter Subscriptions prometheus.Gauge }
func NewServerMetrics ¶
func NewServerMetrics() ServerMetrics
type Subscription ¶
type SubscriptionRequest ¶
type TopicMessage ¶
type TopicMessage struct { ID string `json:"id"` Message json.RawMessage `json:"message"` }
Click to show internal directories.
Click to hide internal directories.