lxd: github.com/lxc/lxd/lxd/events Index | Files

package events

import "github.com/lxc/lxd/lxd/events"

Index

Package Files

events.go logging.go

type Handler Uses

type Handler struct {
}

Handler describes an event handler.

func NewEventHandler Uses

func NewEventHandler() *Handler

NewEventHandler creates and returns a new event handler.

func (Handler) Log Uses

func (h Handler) Log(r *log.Record) error

Log sends a new logging event.

type Listener Uses

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

Listener describes an event listener.

func (*Listener) Connection Uses

func (e *Listener) Connection() *websocket.Conn

Connection returns the underlying websocket connection.

func (*Listener) Deactivate Uses

func (e *Listener) Deactivate()

Deactivate deactivates the event listener.

func (*Listener) ID Uses

func (e *Listener) ID() string

ID returns the listener ID.

func (*Listener) IsDone Uses

func (e *Listener) IsDone() bool

IsDone returns true if the listener is done.

func (*Listener) Lock Uses

func (e *Listener) Lock()

Lock locks the internal mutex.

func (*Listener) MessageTypes Uses

func (e *Listener) MessageTypes() []string

MessageTypes returns a list of message types the listener will be notified of.

func (*Listener) Unlock Uses

func (e *Listener) Unlock()

Unlock unlocks the internal mutex.

func (*Listener) Wait Uses

func (e *Listener) Wait(ctx context.Context)

Wait waits for a message on its active channel or the context is cancelled, then returns.

type Server Uses

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

Server represents an instance of an event server.

var LoggingServer *Server

LoggingServer controls what server to use for messages coming from the logger.

func NewServer Uses

func NewServer(debug bool, verbose bool) *Server

NewServer returns a new event server.

func (*Server) AddListener Uses

func (s *Server) AddListener(group string, connection *websocket.Conn, messageTypes []string, location string, noForward bool) (*Listener, error)

AddListener creates and returns a new event listener.

func (*Server) Forward Uses

func (s *Server) Forward(id int64, event api.Event)

Forward to the local events dispatcher an event received from another node.

func (*Server) Send Uses

func (s *Server) Send(group, eventType string, eventMessage interface{}) error

Send broadcasts a custom event.

func (*Server) SendLifecycle Uses

func (s *Server) SendLifecycle(group, action, source string,
    context map[string]interface{}) error

SendLifecycle broadcasts a lifecycle event.

Package events imports 11 packages (graph) and is imported by 4 packages. Updated 2019-11-03. Refresh now. Tools for package owners.