models

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const SeparatorByte byte = 255

Variables

This section is empty.

Functions

func MustLoadLocation

func MustLoadLocation(name string) *time.Location

Types

type CardProp

type CardProp struct {
	ArticleType         string `json:"articleType"`
	ArticleLib          string `json:"articleLib"`
	ArticleSerialNumber string `json:"articleSerialNumber"`
	ArticleID           int    `json:"articleId"`
}

type Config

type Config struct {
	DNSServer             *DNSServerConfig  `yaml:"dns_server"`
	HTTPServer            *HTTPServerConfig `yaml:"http_server"`
	Entries               Entries           `yaml:"entries"`
	Netdisco              *NetdiscoConfig   `yaml:"netdisco"`
	Workers               *WorkersConfig    `yaml:"workers"`
	Log                   *Log              `yaml:"log"`
	DisableReportsMetrics bool              `yaml:"disable_reports_metrics"`
}

func LoadConfig

func LoadConfig(path string) (Config, error)

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

type DNSServerConfig

type DNSServerConfig struct {
	Disable bool   `yaml:"disable"`
	Listen  string `yaml:"listen"`
}

func (*DNSServerConfig) UnmarshalYAML

func (c *DNSServerConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

type DeviceGrpc added in v0.4.2

type DeviceGrpc struct {
	Name              string           `json:"name"`
	IP                string           `json:"ip"`
	MacAddress        string           `json:"macAddress"`
	DNS               string           `json:"dns"`
	Ports             DeviceGrpcPorts  `json:"ports"`
	SupportedServices DeviceGrpcSupSvc `json:"supportedServices"`
	Mfg               DeviceGrpcMfg    `json:"mfg"`
	Os                DeviceGrpcOs     `json:"os"`
	ChassisID         string           `json:"chassisId"`
	Serial            string           `json:"serial"`
	Uptime            string           `json:"uptime"`
	Description       string           `json:"description"`
	Contact           string           `json:"contact"`
	Location          string           `json:"location"`
	Layers            int              `json:"layers"`
}

func DeviceGrpcFromNetdisco added in v0.4.2

func DeviceGrpcFromNetdisco(device netdisco.Device) DeviceGrpc

type DeviceGrpcMfg added in v0.4.2

type DeviceGrpcMfg struct {
	Name  string `json:"name"`
	Model string `json:"model"`
}

type DeviceGrpcOs added in v0.4.2

type DeviceGrpcOs struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type DeviceGrpcPorts added in v0.4.6

type DeviceGrpcPorts struct {
	Ssh   int32 `json:"ssh"`
	Http  int32 `json:"http"`
	Https int32 `json:"https"`
}

type DeviceGrpcSupSvc added in v0.4.6

type DeviceGrpcSupSvc struct {
	Ssh   bool `json:"ssh"`
	Http  bool `json:"http"`
	Https bool `json:"https"`
}

type Entries

type Entries []*Entry

type Entry

type Entry struct {
	Domain        string                        `yaml:"domain" json:"domain"`
	Routing       *Routing                      `yaml:"routing" json:"-"`
	EnableMetrics bool                          `yaml:"enable_metrics" json:"-"`
	Targets       []*netdisco.SearchDeviceQuery `yaml:"targets" json:"targets"`
}

func (*Entry) UnmarshalYAML

func (e *Entry) UnmarshalYAML(unmarshal func(interface{}) error) error

type HTTPServerConfig

type HTTPServerConfig struct {
	Disable   bool   `yaml:"disable"`
	Listen    string `yaml:"listen"`
	EnableSSL bool   `yaml:"enable_ssl"`
	TLSPem    TLSPem `yaml:"tls_pem"`
}

func (*HTTPServerConfig) UnmarshalYAML

func (c *HTTPServerConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

type Log

type Log struct {
	Level   string `yaml:"level"`
	NoColor bool   `yaml:"no_color"`
	InJson  bool   `yaml:"in_json"`
}

func (*Log) UnmarshalYAML

func (c *Log) UnmarshalYAML(unmarshal func(interface{}) error) error

type Material

type Material struct {
	HostID             int        `json:"hostId,omitempty"`
	Hostname           string     `json:"hostname,omitempty"`
	Hostgroup          string     `json:"hostgroup,omitempty"`
	HostType           string     `json:"hostType,omitempty"`
	HostUsage          string     `json:"hostUsage,omitempty"`
	HostAdditionalInfo string     `json:"hostAdditionalInfo,omitempty"`
	CreationDate       string     `json:"creationDate,omitempty"`
	AllocationDate     string     `json:"allocationDate,omitempty"`
	PfsID              int        `json:"pfsId,omitempty"`
	Pfs                string     `json:"pfs,omitempty"`
	PfsShortName       string     `json:"pfsShortName,omitempty"`
	PfsCriticity       string     `json:"pfsCriticity,omitempty"`
	PfsDomain          string     `json:"pfsDomain,omitempty"`
	MachineID          int        `json:"machineId,omitempty"`
	Machine            string     `json:"machine,omitempty"`
	Equipment          string     `json:"equipment,omitempty"`
	Profile            string     `json:"profile,omitempty"`
	Rampup             int        `json:"rampup,omitempty"`
	ShutdownOrder      int        `json:"shutdownOrder,omitempty"`
	ShutdownLevel      int        `json:"shutdownLevel,omitempty"`
	Env                string     `json:"env,omitempty"`
	SiteID             int        `json:"siteId,omitempty"`
	Site               string     `json:"site,omitempty"`
	Etat               string     `json:"etat,omitempty"`
	RoomID             int        `json:"roomId,omitempty"`
	Room               string     `json:"room,omitempty"`
	Active             int        `json:"active,omitempty"`
	BackIP             string     `json:"backIP,omitempty"`
	IloType            string     `json:"iloType,omitempty"`
	IloIP              string     `json:"iloIP,omitempty"`
	CardProps          []CardProp `json:"-"`
	// contains filtered or unexported fields
}

func (*Material) IP

func (m *Material) IP() net.IP

func (*Material) IsIPv4

func (m *Material) IsIPv4() bool

func (*Material) IsIPv6

func (m *Material) IsIPv6() bool

func (*Material) StringRR

func (m *Material) StringRR(queryType uint16) string

type Metadata

type Metadata struct {
	Count  int `json:"count"`
	Limit  int `json:"limit"`
	Offset int `json:"offset"`
}

type NetdiscoConfig

type NetdiscoConfig struct {
	Endpoint           string `yaml:"endpoint"`
	Username           string `yaml:"username"`
	Password           string `yaml:"password"`
	ApiKey             string `yaml:"api_key"`
	InsecureSkipVerify bool   `yaml:"insecure_skip_verify"`
}

func (*NetdiscoConfig) UnmarshalYAML

func (c *NetdiscoConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

type Routing

type Routing struct {
	Scheme   string                 `yaml:"scheme" json:"scheme"`
	Port     int                    `yaml:"port" json:"port"`
	Host     string                 `yaml:"host" json:"host"`
	Metadata map[string]interface{} `yaml:"metadata" json:"metadata"`
	IP       string                 `yaml:"ip" json:"ip"`
}

func (Routing) UnTemplate

func (r Routing) UnTemplate(device netdisco.Device) (Routing, error)

type SearchQuery

type SearchQuery struct {
	Hostname            string    `json:"hostname" yaml:"hostname"`
	HostId              string    `json:"host_id" yaml:"host_id"`
	PFS                 string    `json:"pfs" yaml:"pfs"`
	PfsShortName        string    `json:"pfs_short_name" yaml:"pfs_short_name"`
	Machine             string    `json:"machine" yaml:"machine"`
	Env                 string    `json:"env" yaml:"env"`
	Equipment           string    `json:"equipment" yaml:"equipment"`
	Profile             string    `json:"profile" yaml:"profile"`
	ProfileID           string    `json:"profile_id" yaml:"profile_id"`
	Active              string    `json:"active" yaml:"active"`
	Etat                string    `json:"etat" yaml:"etat"`
	CreationDate        time.Time `json:"creation_date" yaml:"creation_date"`
	AllocationDate      time.Time `json:"allocation_date" yaml:"allocation_date"`
	OSType              string    `json:"os_type" yaml:"os_type"`
	OSCurrent           string    `json:"os_current" yaml:"os_current"`
	System              string    `json:"system" yaml:"system"`
	Site                string    `json:"site" yaml:"site"`
	LocationHeight      string    `json:"location_height" yaml:"location_height"`
	LocationLabel       string    `json:"location_label" yaml:"location_label"`
	LocationBuilding    string    `json:"location_building" yaml:"location_building"`
	LocationRoom        string    `json:"location_room" yaml:"location_room"`
	LocationStreet      string    `json:"location_street" yaml:"location_street"`
	LocationBay         string    `json:"location_bay" yaml:"location_bay"`
	LocationSlot        string    `json:"location_slot" yaml:"location_slot"`
	LocationFace        string    `json:"location_face" yaml:"location_face"`
	ArticleType         string    `json:"article_type" yaml:"article_type"`
	ArticleLib          string    `json:"article_lib" yaml:"article_lib"`
	ArticleSerialNumber string    `json:"article_serial_number" yaml:"article_serial_number"`
	ArticleId           string    `json:"article_id" yaml:"article_id"`
	// contains filtered or unexported fields
}

func (*SearchQuery) Id

func (q *SearchQuery) Id() uint64

func (*SearchQuery) Serialize

func (q *SearchQuery) Serialize() url.Values

type SearchRequest added in v0.5.0

type SearchRequest struct {
	HostMatch              string
	ManufacturerNameMatch  string
	ManufacturerModelMatch string
	LocationMatch          string
	LayersMatch            string
	SerialMatch            string
	OsName                 string
	OsVersion              string
	MatchAll               bool
}

func (*SearchRequest) Empty added in v0.5.0

func (r *SearchRequest) Empty() bool

type SearchResponse

type SearchResponse struct {
	Metadata Metadata    `json:"metadata"`
	Result   []*Material `json:"result"`
}

type SnmpInfo

type SnmpInfo struct {
	Description      string
	EnterpriseName   string
	ObjectIdentifier string
	Uptime           time.Duration
	Contact          string
	Name             string
	Location         string
	Services         int64
}

type TLSPem

type TLSPem struct {
	CertChain  string `yaml:"cert_chain"`
	PrivateKey string `yaml:"private_key"`
}

func (TLSPem) BuildCertif

func (t TLSPem) BuildCertif() (tls.Certificate, error)

type WorkersConfig

type WorkersConfig struct {
	NbWorkers       int             `yaml:"nb_workers"`
	RefreshInterval pmodel.Duration `yaml:"refresh_interval"`
}

func (*WorkersConfig) UnmarshalYAML

func (c *WorkersConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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