diff options
| author | 2026-02-22 20:15:50 +0300 | |
|---|---|---|
| committer | 2026-02-22 20:15:50 +0300 | |
| commit | db8bb97dfa2dacef002a1f349ea970d76fee4fc9 (patch) | |
| tree | 7de11be3a01a6ef83a218dc98d90586dd1afb09a /model/doc.go | |
| parent | Добавил утилитарные функции для моделей (diff) | |
| download | conf-db8bb97dfa2dacef002a1f349ea970d76fee4fc9.tar.gz conf-db8bb97dfa2dacef002a1f349ea970d76fee4fc9.tar.bz2 conf-db8bb97dfa2dacef002a1f349ea970d76fee4fc9.tar.xz conf-db8bb97dfa2dacef002a1f349ea970d76fee4fc9.zip | |
Refactoringv0.0.4
Diffstat (limited to '')
| -rw-r--r-- | model/doc.go | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/model/doc.go b/model/doc.go deleted file mode 100644 index 9c13a4c..0000000 --- a/model/doc.go +++ /dev/null @@ -1,41 +0,0 @@ -package model - -type Doc struct { - items []any - vars map[string]Values - commands map[string]Commands -} - -func New(cap int) *Doc { - return &Doc{ - items: make([]any, 0, cap), - vars: make(map[string]Values, cap), - commands: make(map[string]Commands, cap), - } -} - -func (d *Doc) AppendAssignment(e *Assignment) { - d.items = append(d.items, e) - d.vars[e.Key] = append(d.vars[e.Key], e.Value...) -} - -func (d *Doc) AppendCommand(c *Command) { - d.items = append(d.items, c) - d.commands[c.Name] = append(d.commands[c.Name], c) -} - -func (d *Doc) Vars() map[string]Values { - return d.vars -} - -func (d *Doc) Get(key string) Values { - return d.vars[key] -} - -func (d *Doc) Commands(name string) Commands { - return d.commands[name] -} - -func (d *Doc) Items() []any { - return d.items -} |
