Documentation
¶
Index ¶
- func PacketID(ctx context.Context) uint32
- func SessionID(ctx context.Context) uint32
- func TransactionID(ctx context.Context) uint32
- type Client
- type DialOption
- type Handler
- type ListHandler
- func (l *ListHandler) Add(oid string) *ListItem
- func (l *ListHandler) Get(ctx context.Context, oid value.OID) (value.OID, pdu.VariableType, any, error)
- func (l *ListHandler) GetNext(ctx context.Context, from value.OID, includeFrom bool, to value.OID) (value.OID, pdu.VariableType, any, error)
- func (l *ListHandler) Set(ctx context.Context, oid value.OID, t pdu.VariableType, value any) error
- type ListItem
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TransactionID ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client defines an agentx client.
type DialOption ¶
type DialOption func(o *dialOptions)
func WithErrorHandler ¶ added in v0.3.3
func WithErrorHandler(handler func(error)) DialOption
func WithLogger ¶
func WithLogger(value *slog.Logger) DialOption
func WithReconnectInterval ¶
func WithReconnectInterval(value time.Duration) DialOption
func WithTimeout ¶
func WithTimeout(value time.Duration) DialOption
type Handler ¶
type Handler interface {
Get(context.Context, value.OID) (value.OID, pdu.VariableType, any, error)
GetNext(context.Context, value.OID, bool, value.OID) (value.OID, pdu.VariableType, any, error)
Set(context.Context, value.OID, pdu.VariableType, any) error
}
Handler defines an interface for a handler of events that might occure during a session.
type ListHandler ¶
type ListHandler struct {
// contains filtered or unexported fields
}
ListHandler is a helper that takes a list of oids and implements a default behaviour for that list.
func (*ListHandler) Add ¶
func (l *ListHandler) Add(oid string) *ListItem
Add adds a list item for the provided oid and returns it.
func (*ListHandler) Get ¶
func (l *ListHandler) Get(ctx context.Context, oid value.OID) (value.OID, pdu.VariableType, any, error)
Get tries to find the provided oid and returns the corresponding value.
type ListItem ¶
type ListItem struct {
Type pdu.VariableType
Value interface{}
}
ListItem defines an item of the list handler.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session defines an agentx session.
func (*Session) Register ¶
Register registers the client under the provided rootID with the provided priority on the master agent.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.