models

package
v0.0.0-...-47ab91c Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bibliography

type Bibliography struct {
	References []Reference `xml:"reference"`
}

Bibliography contains references used in the document

type Boolean

type Boolean struct{}

Boolean represents a boolean parameter type

type DataModel

type DataModel struct {
	XMLName     xml.Name    `xml:"model"`
	Name        string      `xml:"name,attr"`
	Description string      `xml:"description,omitempty"`
	Version     string      `xml:"version,attr,omitempty"`
	Objects     []Object    `xml:"object"`
	Parameters  []Parameter `xml:"parameter"`
}

DataModel represents a CWMP data model

type DataType

type DataType struct {
	Name        string      `xml:"name,attr"`
	Description string      `xml:"description,omitempty"`
	String      *StringType `xml:"string,omitempty"`
}

DataType represents a custom data type definition

type DataTypeRef

type DataTypeRef struct {
	Ref string `xml:"ref,attr"`
}

DataTypeRef references a custom data type

type DateTime

type DateTime struct{}

DateTime represents a dateTime parameter type

type Document

type Document struct {
	XMLName      xml.Name     `xml:"document"`
	Xmlns        string       `xml:"xmlns,attr,omitempty"`
	Spec         string       `xml:"spec,attr,omitempty"`
	DataTypes    []DataType   `xml:"dataType"`
	Bibliography Bibliography `xml:"bibliography"`
	Models       []DataModel  `xml:"model"`
}

Document represents the top-level XML element in a CWMP data model file

type Enumeration

type Enumeration struct {
	Value    string `xml:"value,attr"`
	Optional string `xml:"optional,attr,omitempty"`
}

Enumeration defines an enum value

type List

type List struct {
	Size *Size `xml:"size,omitempty"`
}

List defines a list parameter

type Object

type Object struct {
	Name                string      `xml:"name,attr"`
	Description         string      `xml:"description,omitempty"`
	Access              string      `xml:"access,attr,omitempty"`
	MinEntries          string      `xml:"minEntries,attr,omitempty"`
	MaxEntries          string      `xml:"maxEntries,attr,omitempty"`
	NumEntriesParameter string      `xml:"numEntriesParameter,attr,omitempty"`
	EnableParameter     string      `xml:"enableParameter,attr,omitempty"`
	UniqueKeys          []UniqueKey `xml:"uniqueKey"`
	Objects             []Object    `xml:"object"`
	Parameters          []Parameter `xml:"parameter"`
	MultiInstance       bool        // Derived field for code generation
	Path                string      // Full path including parent object paths
	HasIndexPlaceholder bool        // Whether the path contains an {i} placeholder
	ParentPath          string      // Path to parent object
	BaseName            string      // Name without the trailing dot (if any)
}

Object represents a CWMP object

func (*Object) GetPath

func (o *Object) GetPath() string

GetPath returns the full path to this object

func (*Object) IsMultiInstance

func (o *Object) IsMultiInstance() bool

IsMultiInstance returns true if this object can have multiple instances

type Parameter

type Parameter struct {
	Name        string `xml:"name,attr"`
	Description string `xml:"description,omitempty"`
	Access      string `xml:"access,attr,omitempty"`
	Syntax      Syntax `xml:"syntax"`
	Type        string // Derived field for code generation
	ParentPath  string // Path to parent object
	FullPath    string // Complete path including parent
}

Parameter represents a CWMP parameter

func (*Parameter) GetFullPath

func (p *Parameter) GetFullPath() string

GetFullPath returns the full path to this parameter including parent paths

type ParameterRef

type ParameterRef struct {
	Ref string `xml:"ref,attr"`
}

ParameterRef is a reference to a parameter

type Pattern

type Pattern struct {
	Value   string `xml:"value,attr,omitempty"`
	Content string `xml:",chardata"`
}

Pattern represents a validation pattern

type Range

type Range struct {
	MinInclusive string `xml:"minInclusive,attr,omitempty"`
	MaxInclusive string `xml:"maxInclusive,attr,omitempty"`
	Min          string `xml:"min,attr,omitempty"`
	Max          string `xml:"max,attr,omitempty"`
}

Range defines min/max values for a parameter

type Reference

type Reference struct {
	ID           string `xml:"id,attr"`
	Name         string `xml:"name"`
	Title        string `xml:"title,omitempty"`
	Organization string `xml:"organization,omitempty"`
	Category     string `xml:"category,omitempty"`
	Date         string `xml:"date,omitempty"`
	Hyperlink    string `xml:"hyperlink,omitempty"`
}

Reference represents a bibliographic reference

type Size

type Size struct {
	Min int `xml:"min,attr,omitempty"`
	Max int `xml:"maxLength,attr,omitempty"`
}

Size defines size constraints for a parameter

type StringCons

type StringCons struct {
	Size        *Size         `xml:"size,omitempty"`
	Enumeration []Enumeration `xml:"enumeration,omitempty"`
}

StringCons defines string constraints

type StringType

type StringType struct {
	Size    *Size     `xml:"size,omitempty"`
	Pattern []Pattern `xml:"pattern,omitempty"`
}

StringType represents string data type constraints

type Syntax

type Syntax struct {
	Hidden      string       `xml:"hidden,attr,omitempty"`
	Default     string       `xml:"default,omitempty"`
	List        *List        `xml:"list,omitempty"`
	String      *StringCons  `xml:"string,omitempty"`
	Boolean     *Boolean     `xml:"boolean,omitempty"`
	DateTime    *DateTime    `xml:"dateTime,omitempty"`
	UnsignedInt *UnsignedInt `xml:"unsignedInt,omitempty"`
	DataTypeRef *DataTypeRef `xml:"dataType,omitempty"`
}

Syntax defines the value constraints for a parameter

type UniqueKey

type UniqueKey struct {
	Parameters []ParameterRef `xml:"parameter"`
}

UniqueKey represents a unique key constraint

type UnsignedInt

type UnsignedInt struct {
	Range *Range `xml:"range,omitempty"`
}

UnsignedInt represents an unsignedInt parameter type

Jump to

Keyboard shortcuts

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