httpsink

package
v0.0.0-...-0390e60 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package httpsink sends event to the machine server via HTTP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPSink

type HTTPSink struct {
	// contains filtered or unexported fields
}

HTTPSink implements event.Sink.

All the HTTP requests to the server include an Authorization: Bearer token header that is populated from Default Application Credentials.

func NewFromClient

func NewFromClient(client *http.Client, serverURL string) (*HTTPSink, error)

NewFromClient returns an instance of HTTPSink.

serverURL is the scheme, host, and optionally the port of the server to send requests to as a string, for example: "https://machines.skia.org".

The client must be configured to make all the HTTP requests to the server include an Authorization: Bearer token header, which is authorized as an Editor of machineserver.

func (*HTTPSink) Send

func (h *HTTPSink) Send(ctx context.Context, event machine.Event) error

Send implements event.Sink.

Jump to

Keyboard shortcuts

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