https

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package https provides comms.Communicator implementations which connect to the Fleetspeak server using HTTPS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetContentEncoding added in v0.1.16

func SetContentEncoding(h http.Header, compression fspb.CompressionAlgorithm)

SetContentEncoding sets the Content-Encoding header on req to the appropriate value for the given compression algorithm.

Types

type BodyWriter added in v0.1.16

type BodyWriter interface {
	io.WriteCloser
	Flush() error
}

BodyWriter is an interface that groups Write, Flush, and Close functions.

func CompressingWriter added in v0.1.16

func CompressingWriter(w io.Writer, compression fspb.CompressionAlgorithm) BodyWriter

CompressingWriter returns a BodyWriter that will compress the data written to it with the given compression algorithm and write it to w.

type Communicator

type Communicator struct {
	DialContext func(ctx context.Context, network, addr string) (net.Conn, error) // If set, will be used to initiate network connections to the server.
	// contains filtered or unexported fields
}

Communicator implements comms.Communicator and communicates with a Fleetspeak server using https.

func (*Communicator) GetFileIfModified

func (c *Communicator) GetFileIfModified(ctx context.Context, service, name string, modSince time.Time) (io.ReadCloser, time.Time, error)

func (*Communicator) Setup

func (c *Communicator) Setup(cl comms.Context) error

Setup implements comms.Communicator.

func (*Communicator) Start

func (c *Communicator) Start() error

Start implements comms.Communicator.

func (*Communicator) Stop

func (c *Communicator) Stop()

Stop implements comms.Communicator.

type StreamingCommunicator

type StreamingCommunicator struct {
	DialContext func(ctx context.Context, network, addr string) (net.Conn, error) // If set, will be used to initiate network connections to the server.
	// contains filtered or unexported fields
}

StreamingCommunicator is a comms.Communicator that communicates with the fleetspeak server via HTTPS and long lived connections.

func (*StreamingCommunicator) GetFileIfModified

func (c *StreamingCommunicator) GetFileIfModified(ctx context.Context, service, name string, modSince time.Time) (io.ReadCloser, time.Time, error)

func (*StreamingCommunicator) Setup

Setup implements comms.Communicator.

func (*StreamingCommunicator) Start

func (c *StreamingCommunicator) Start() error

Start implements comms.Communicator.

func (*StreamingCommunicator) Stop

func (c *StreamingCommunicator) Stop()

Stop implements comms.Communicator.

Jump to

Keyboard shortcuts

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