sonic

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InterfaceNamingSchemaDefault = InterfaceNamingSchema("default")
	InterfaceNamingSchemaSwap    = InterfaceNamingSchema("swap")
	InterfaceNamingSchemaName    = InterfaceNamingSchema("name")
	InterfaceNamingSchemaAlias   = InterfaceNamingSchema("alias")
)
View Source
const (
	SonicVersionFile = "/etc/sonic/sonic_version.yml"
)

Variables

This section is empty.

Functions

func NewFrrApplier

func NewFrrApplier(log *slog.Logger, tplPath string) *templates.Applier

Types

type InterfaceNamingSchema added in v0.18.0

type InterfaceNamingSchema string

type PortInfo

type PortInfo struct {
	Alias string `json:"alias"`
}

type Sonic

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

func New

func New(log *slog.Logger, frrTplFile string, interfaceNamingSchema InterfaceNamingSchema) (*Sonic, error)

func (*Sonic) Apply

func (s *Sonic) Apply(ctx context.Context, cfg *types.Conf) error

func (*Sonic) GetManagement

func (s *Sonic) GetManagement() (ip, user string, err error)

func (*Sonic) GetNics

func (s *Sonic) GetNics(ctx context.Context, blacklist []string) (nics []*apiv2.SwitchNic, err error)

func (*Sonic) GetOS

func (s *Sonic) GetOS() (*apiv2.SwitchOS, error)

func (*Sonic) GetSwitchPorts

func (s *Sonic) GetSwitchPorts(ctx context.Context) ([]*net.Interface, error)

func (*Sonic) IsInitialized

func (s *Sonic) IsInitialized(ctx context.Context) (initialized bool, err error)

func (*Sonic) SanitizeConfig

func (s *Sonic) SanitizeConfig(cfg *types.Conf)

Directories

Path Synopsis
db

Jump to

Keyboard shortcuts

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