scraper

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoSNMPWrapper

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

func NewGoSNMP

func NewGoSNMP(logger *slog.Logger, target, srcAddress string, debug bool) (*GoSNMPWrapper, error)

func (*GoSNMPWrapper) Close

func (g *GoSNMPWrapper) Close() error

func (*GoSNMPWrapper) Connect

func (g *GoSNMPWrapper) Connect() error

func (*GoSNMPWrapper) Get

func (g *GoSNMPWrapper) Get(oids []string) (*gosnmp.SnmpPacket, error)

func (*GoSNMPWrapper) SetOptions

func (g *GoSNMPWrapper) SetOptions(fns ...func(*gosnmp.GoSNMP))

func (*GoSNMPWrapper) WalkAll

func (g *GoSNMPWrapper) WalkAll(oid string) ([]gosnmp.SnmpPDU, error)

type MockSNMPScraper added in v0.31.0

type MockSNMPScraper struct {
	GetResponses  map[string]gosnmp.SnmpPDU
	WalkResponses map[string][]gosnmp.SnmpPDU
	ConnectError  error
	CloseError    error
	// contains filtered or unexported fields
}

func NewMockSNMPScraper

func NewMockSNMPScraper(get map[string]gosnmp.SnmpPDU, walk map[string][]gosnmp.SnmpPDU) *MockSNMPScraper

func (*MockSNMPScraper) CallGet added in v0.31.0

func (m *MockSNMPScraper) CallGet() []string

func (*MockSNMPScraper) CallWalk added in v0.31.0

func (m *MockSNMPScraper) CallWalk() []string

func (*MockSNMPScraper) Close added in v0.31.0

func (m *MockSNMPScraper) Close() error

func (*MockSNMPScraper) Connect added in v0.31.0

func (m *MockSNMPScraper) Connect() error

func (*MockSNMPScraper) Get added in v0.31.0

func (m *MockSNMPScraper) Get(oids []string) (*gosnmp.SnmpPacket, error)

func (*MockSNMPScraper) SetOptions added in v0.31.0

func (m *MockSNMPScraper) SetOptions(...func(*gosnmp.GoSNMP))

func (*MockSNMPScraper) WalkAll added in v0.31.0

func (m *MockSNMPScraper) WalkAll(baseOID string) ([]gosnmp.SnmpPDU, error)

type SNMPScraper

type SNMPScraper interface {
	Get([]string) (*gosnmp.SnmpPacket, error)
	WalkAll(string) ([]gosnmp.SnmpPDU, error)
	Connect() error
	Close() error
	SetOptions(...func(*gosnmp.GoSNMP))
}

Jump to

Keyboard shortcuts

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