f860

package
v0.0.0-...-f3d68a8 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultEncryptionKeyBytes

func DefaultEncryptionKeyBytes() []byte

Types

type BaseAjaxRsp

type BaseAjaxRsp struct {
	XMLName xml.Name `xml:"ajax_response_xml_root"`
	ErrorID struct {
		XMLName xml.Name `xml:"IF_ERRORID"`
		Value   string   `xml:",chardata"`
	}
	ErrorStr struct {
		XMLName xml.Name `xml:"IF_ERRORSTR"`
		Value   string   `xml:",chardata"`
	}
}

func (*BaseAjaxRsp) RemoteError

func (r *BaseAjaxRsp) RemoteError() error

type Client

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

func NewClient

func NewClient(routerConfig RouterConfig, opts ...Option) (*Client, error)

func (*Client) LanDevDHCPSources

func (c *Client) LanDevDHCPSources(ctx context.Context) ([]DevDHCPSource, error)

func (*Client) Login

func (c *Client) Login(ctx context.Context) (bool, error)

func (*Client) Reset

func (c *Client) Reset() error

func (*Client) UpdateLanDevDHCPSource

func (c *Client) UpdateLanDevDHCPSource(ctx context.Context, sources ...DevDHCPSource) error

type DHCPSourceKind

type DHCPSourceKind uint8
const (
	DHCPSourceKindNone     DHCPSourceKind = 0
	DHCPSourceKindLocal    DHCPSourceKind = 1
	DHCPSourceKindInternet DHCPSourceKind = 2
)

func (*DHCPSourceKind) FromRouter

func (k *DHCPSourceKind) FromRouter(in string) error

func (DHCPSourceKind) MarshalJSON

func (k DHCPSourceKind) MarshalJSON() ([]byte, error)

func (DHCPSourceKind) MarshalYAML

func (k DHCPSourceKind) MarshalYAML() (interface{}, error)

func (DHCPSourceKind) Router

func (k DHCPSourceKind) Router() string

func (DHCPSourceKind) String

func (k DHCPSourceKind) String() string

func (*DHCPSourceKind) UnmarshalJSON

func (k *DHCPSourceKind) UnmarshalJSON(in []byte) error

func (*DHCPSourceKind) UnmarshalText

func (k *DHCPSourceKind) UnmarshalText(in []byte) error

func (*DHCPSourceKind) UnmarshalYAML

func (k *DHCPSourceKind) UnmarshalYAML(val *yaml.Node) error

type DevDHCPSource

type DevDHCPSource struct {
	ID            string
	ProcFlag      DHCPSourceKind
	VendorClassID string
}

type EncryptionKey

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

func ParseEncryptionKey

func ParseEncryptionKey(pubKey []byte) (*EncryptionKey, error)

func (*EncryptionKey) Encrypt

func (k *EncryptionKey) Encrypt(msg []byte) ([]byte, error)

type ErrUnauthorized

type ErrUnauthorized struct{}

func (*ErrUnauthorized) Error

func (m *ErrUnauthorized) Error() string

type Option

type Option func(*Client)

func WithDebug

func WithDebug(debug bool) Option

func WithEncryptionKey

func WithEncryptionKey(key *EncryptionKey) Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

type RouterConfig

type RouterConfig struct {
	Upstream string
	Username string
	Password string
}

Jump to

Keyboard shortcuts

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