sse

package
v0.0.0-...-92766a4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFrom

func GetFrom(ctx context.Context, url string, id string) ([]events.Event, error)

GetFrom gets all events from an ESR instance starting from id (including the id specified).

func GetOne

func GetOne(ctx context.Context, url string, id string) (events.Event, error)

GetOne gets a single event from an ESR instance.

func New

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

Selftest is a handler to just return 204.

func (SSEHandler) Subscribe

func (h SSEHandler) Subscribe(ch chan<- events.Event, logger *logrus.Entry, ctx context.Context, counter int, identifier string, url string)

Subscribe subscribes to an ETOS suite runner instance and gets logs and events from it and writes them to a channel.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL