agentd

package
v5.10.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: MIT, MIT, MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agentd

type Agentd struct {
	// Host is the hostname Agentd is running on.
	Host string

	// Port is the port Agentd is running on.
	Port int
	// contains filtered or unexported fields
}

Agentd is the backend HTTP API.

func New

func New(c Config, opts ...Option) (*Agentd, error)

New creates a new Agentd.

func (*Agentd) Err

func (a *Agentd) Err() <-chan error

Err returns a channel to listen for terminal errors on.

func (*Agentd) Name

func (a *Agentd) Name() string

Name returns the daemon name

func (*Agentd) Start

func (a *Agentd) Start() error

Start Agentd.

func (*Agentd) Stop

func (a *Agentd) Stop() error

Stop Agentd.

type Config

type Config struct {
	Host     string
	Port     int
	Bus      messaging.MessageBus
	Store    store.Store
	TLS      *types.TLSOptions
	RingPool *ringv2.Pool
}

Config configures an Agentd.

type Option

type Option func(*Agentd) error

Option is a functional option.

type Session

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

A Session is a server-side connection between a Sensu backend server and the Sensu agent process via the Sensu transport. It is responsible for relaying messages to the message bus on behalf of the agent and from the bus to the agent from other daemons. It handles transport handshaking and transport channel multiplexing/demultiplexing.

func NewSession

func NewSession(cfg SessionConfig, conn transport.Transport, bus messaging.MessageBus, store Store) (*Session, error)

NewSession creates a new Session object given the triple of a transport connection, message bus, and store. The Session is responsible for stopping itself, and does so when it encounters a receive error.

func (*Session) Receiver

func (s *Session) Receiver() chan<- interface{}

Receiver returns the check channel for the session.

func (*Session) Start

func (s *Session) Start() (err error)

Start a Session. 1. Start send pump 2. Start receive pump 3. Start subscription pump 5. Ensure bus unsubscribe when the session shuts down.

func (*Session) Stop

func (s *Session) Stop()

Stop a running session. This will cause the send and receive loops to shutdown. Blocks until the session has shutdown.

type SessionConfig

type SessionConfig struct {
	Namespace     string
	AgentAddr     string
	AgentName     string
	User          string
	Subscriptions []string
	RingPool      *ringv2.Pool
}

A SessionConfig contains all of the ncessary information to initialize an agent session.

type SessionStore

type SessionStore interface {
	store.EntityStore
	store.NamespaceStore
}

SessionStore specifies the storage requirements of the Session.

type Store

type Store interface {
	middlewares.AuthStore
	SessionStore
}

Store specifies storage requirements for Agentd.

Jump to

Keyboard shortcuts

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