model

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

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

func New

func New() *Document

func (*Document) All

func (d *Document) All(yield func(string, Value) bool)

func (*Document) CreateList

func (d *Document) CreateList(key string) (*List, error)

func (*Document) CreateMap

func (d *Document) CreateMap(key string) (IMap, error)

func (*Document) Delete

func (d *Document) Delete(key string)

func (*Document) Get

func (m *Document) Get(key string) Value

func (*Document) GetKind

func (d *Document) GetKind(key string) KindValue

func (*Document) GetList

func (d *Document) GetList(key string) (*List, error)

func (*Document) GetMap

func (d *Document) GetMap(key string) (IMap, error)

func (*Document) Has

func (d *Document) Has(key string) bool

func (*Document) Keys

func (d *Document) Keys() []string

func (*Document) Kind

func (d *Document) Kind() KindValue

func (*Document) Len

func (d *Document) Len() int

func (*Document) ToList

func (d *Document) ToList() (*List, error)

func (*Document) ToMap

func (d *Document) ToMap() (IMap, error)

func (*Document) ToString

func (d *Document) ToString() (*String, error)

type IMap

type IMap interface {
	Value

	CreateList(key string) (*List, error)
	CreateMap(key string) (IMap, error)
	Delete(key string)
	GetKind(key string) KindValue
	GetList(key string) (*List, error)
	GetMap(key string) (IMap, error)
	Has(key string) bool
	Get(key string) Value
	Keys() []string
	All(yield func(string, Value) bool)
}

type KindValue

type KindValue int
const (
	KV_NONE KindValue = iota
	KV_LIST
	KV_MAP
	KV_STRING
)

func (KindValue) String

func (k KindValue) String() string

type List

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

func (*List) All

func (d *List) All(yield func(int, Value) bool)

func (*List) AppendNewList

func (l *List) AppendNewList() *List

func (*List) AppendNewMap

func (l *List) AppendNewMap() *Map

func (*List) AppendString

func (l *List) AppendString(value string)

func (*List) Delete

func (l *List) Delete(index int)

func (*List) DeleteFirst

func (l *List) DeleteFirst()

func (*List) DeleteLast

func (l *List) DeleteLast()

func (*List) Get

func (l *List) Get(i int) Value

func (*List) GetKind

func (l *List) GetKind(index int) (KindValue, error)

func (*List) GetKindFirst

func (l *List) GetKindFirst() (KindValue, error)

func (*List) GetKindLast

func (l *List) GetKindLast() (KindValue, error)

func (*List) GetList

func (l *List) GetList(index int) (*List, error)

func (*List) GetListFirst

func (l *List) GetListFirst() (*List, error)

func (*List) GetListLast

func (l *List) GetListLast() (*List, error)

func (*List) GetMap

func (l *List) GetMap(index int) (*Map, error)

func (*List) GetMapFirst

func (l *List) GetMapFirst() (*Map, error)

func (*List) GetMapLast

func (l *List) GetMapLast() (*Map, error)

func (*List) GetString

func (l *List) GetString(index int) (string, error)

func (*List) GetStringFirst

func (l *List) GetStringFirst() (string, error)

func (*List) GetStringLast

func (l *List) GetStringLast() (string, error)

func (*List) InsertNewList

func (l *List) InsertNewList(index int) (*List, error)

func (*List) InsertNewMap

func (l *List) InsertNewMap(index int) (*Map, error)

func (*List) InsertString

func (l *List) InsertString(index int, value string) error

func (*List) InsertStringModel added in v0.1.5

func (l *List) InsertStringModel(index int) (*String, error)

func (*List) Kind

func (l *List) Kind() KindValue

func (*List) Len

func (l *List) Len() int

func (*List) PrependNewList

func (l *List) PrependNewList() *List

func (*List) PrependNewMap

func (l *List) PrependNewMap() *Map

func (*List) PrependString

func (l *List) PrependString(value string)

func (*List) SetString

func (l *List) SetString(index int, value string) error

func (*List) SetStringEnd

func (l *List) SetStringEnd(value string) error

func (*List) SetStringStart

func (l *List) SetStringStart(value string) error

func (*List) ToList

func (l *List) ToList() (*List, error)

func (*List) ToMap

func (*List) ToMap() (IMap, error)

func (*List) ToString

func (*List) ToString() (*String, error)

type Map

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

func (*Map) All

func (m *Map) All(yield func(string, Value) bool)

func (*Map) CreateList

func (m *Map) CreateList(key string) (*List, error)

func (*Map) CreateMap

func (m *Map) CreateMap(key string) (IMap, error)

func (*Map) Delete

func (m *Map) Delete(key string)

func (*Map) Get

func (m *Map) Get(key string) Value

func (*Map) GetKind

func (m *Map) GetKind(key string) KindValue

func (*Map) GetList

func (m *Map) GetList(key string) (*List, error)

func (*Map) GetMap

func (m *Map) GetMap(key string) (IMap, error)

func (*Map) Has

func (m *Map) Has(key string) bool

func (*Map) Keys

func (m *Map) Keys() []string

func (*Map) Kind

func (m *Map) Kind() KindValue

func (*Map) Len

func (m *Map) Len() int

func (*Map) ToList

func (*Map) ToList() (*List, error)

func (*Map) ToMap

func (m *Map) ToMap() (IMap, error)

func (*Map) ToString

func (*Map) ToString() (*String, error)

type String

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

func NewString added in v0.1.5

func NewString(value string) *String

func (*String) Get

func (s *String) Get() string

func (*String) Kind

func (s *String) Kind() KindValue

func (*String) Len

func (s *String) Len() int

func (*String) Set

func (s *String) Set(value string)

func (*String) ToList

func (*String) ToList() (*List, error)

func (*String) ToMap

func (*String) ToMap() (IMap, error)

func (*String) ToString

func (s *String) ToString() (*String, error)

type Value

type Value interface {
	Kind() KindValue
	Len() int

	ToString() (*String, error)
	ToList() (*List, error)
	ToMap() (IMap, error)
}

Jump to

Keyboard shortcuts

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