Documentation ¶
Overview ¶
Copyright Axis Communications AB.
For a full list of individual contributors, please see the commit history.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func GetFrom(ctx context.Context, url string, id string) ([]events.Event, error)
- func GetOne(ctx context.Context, url string, id string) (events.Event, error)
- func New(cfg config.Config, log *logrus.Entry, ctx context.Context) application.Application
- type SSEApplication
- type SSEHandler
- func (h SSEHandler) GetEvent(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (h SSEHandler) GetEvents(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
- func (h SSEHandler) Selftest(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- func (h SSEHandler) Subscribe(ch chan<- events.Event, logger *logrus.Entry, ctx context.Context, counter int, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFrom ¶
GetFrom gets all events from an ESR instance starting from id (including the id specified).
func New ¶
func New(cfg config.Config, log *logrus.Entry, ctx context.Context) application.Application
New returns a new SSEApplication object/struct
Types ¶
type SSEApplication ¶
type SSEApplication struct {
// contains filtered or unexported fields
}
func (*SSEApplication) Close ¶
func (a *SSEApplication) Close()
Close cancels the application context
func (SSEApplication) LoadRoutes ¶
func (a SSEApplication) LoadRoutes(router *httprouter.Router)
LoadRoutes loads all the v1 routes.
type SSEHandler ¶
type SSEHandler struct {
// contains filtered or unexported fields
}
func (SSEHandler) GetEvent ¶
func (h SSEHandler) GetEvent(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
GetEvent is an endpoint for getting a single event from an ESR instance.
func (SSEHandler) GetEvents ¶
func (h SSEHandler) GetEvents(w http.ResponseWriter, r *http.Request, ps httprouter.Params)
GetEvents is an endpoint for streaming events and logs from an ESR instance.
func (SSEHandler) Selftest ¶
func (h SSEHandler) Selftest(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
Selftest is a handler to just return 204.