cira

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrChannelOpenFailed is returned when an APF channel open request fails.
	ErrChannelOpenFailed = errors.New("channel open failed")
)

Functions

This section is empty.

Types

type APFHandler

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

APFHandler implements apf.Handler for the CIRA server. It provides application-specific logic for authentication and device registration.

func NewAPFHandler

func NewAPFHandler(d devices.Feature, l logger.Interface) *APFHandler

NewAPFHandler creates a new APF handler with access to the devices feature.

func (*APFHandler) DeviceID

func (h *APFHandler) DeviceID() string

DeviceID returns the device ID extracted from the protocol version message.

func (*APFHandler) OnAuthRequest

func (h *APFHandler) OnAuthRequest(request apf.AuthRequest) apf.AuthResponse

OnAuthRequest is called when an APF_USERAUTH_REQUEST message is received. Validates credentials against the database.

func (*APFHandler) OnGlobalRequest

func (h *APFHandler) OnGlobalRequest(request apf.GlobalRequest) bool

OnGlobalRequest is called when an APF_GLOBAL_REQUEST message is received. Tracks TCP forwarding requests and returns true when keep-alive should be sent.

func (*APFHandler) OnProtocolVersion

func (h *APFHandler) OnProtocolVersion(info apf.ProtocolVersionInfo) error

OnProtocolVersion is called when an APF_PROTOCOLVERSION message is received. Extracts and stores the device UUID for later use.

func (*APFHandler) ShouldSendKeepAlive

func (h *APFHandler) ShouldSendKeepAlive() bool

ShouldSendKeepAlive returns whether keep-alive should be sent based on global request count.

type Server

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

func NewServer

func NewServer(certFile, keyFile string, d devices.Feature, l logger.Interface) (*Server, error)

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

func (*Server) Notify

func (s *Server) Notify() <-chan error

Notify returns the error channel for server notifications.

func (*Server) Shutdown

func (s *Server) Shutdown() error

Shutdown gracefully shuts down the CIRA server.

Jump to

Keyboard shortcuts

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