dot

package
v0.0.0-...-4b9bf86 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Example
package main

import (
	dot "github.com/GoLangsam/container/ccsafe/tagmap"
)

func main() {
	var sms *dot.Dot = dot.New("<root>")
	//	sms.PrintTree("1 >>")
	sms.Assignss("foo", "bar")
	//	sms.PrintTree("1 >>")
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssignFriendly

type AssignFriendly interface {
	Assignss(vals ...string) *Dot           // Assign/overwrite Content with val - given as strings
	AssignSs(val ...[]string) *Dot          // Assign/overwrite Content with val - given as slices of strings
	AssignMs(val ...map[string]string) *Dot // Assign/overwrite Content with val - given as maps of strings
}

AssignFriendly - interface exposed for go doc only

type ChildFriendly

type ChildFriendly interface {
	// contains filtered or unexported methods
}

ChildFriendly - interface exposed for go doc only

type DeleteFriendly

type DeleteFriendly interface {
	Deletess(vals ...string) *Dot            // Delete/remove vals from Content - given as strings
	DeleteSs(vals ...[]string) *Dot          // Delete/remove val from Content - given as slices of strings
	DeleteMs(vals ...map[string]string) *Dot // Delete/remove val from Content - given as maps of strings
}

DeleteFriendly - interface exposed for go doc only

type Dot

type Dot struct {
	*tag.TagAny          // key - a Key Value Pair
	*lsm.LazyStringerMap // value(s) - an 'Anything' StringMap
	// contains filtered or unexported fields
}

Dot is the type provided by package dot

func New

func New(key string) *Dot

New returns what You need in order to keep a hand on me :-)

func Try

func Try(v interface{}) (*Dot, bool)

Try returns anything as a *Dot, or nil and false, iff no *Dot was given.

func (*Dot) A

func (d *Dot) A(vals ...string) string

A is a helper method for templates: Add value(s), and return an empty string

func (*Dot) AddMap

func (d *Dot) AddMap(key string, val ...map[string]string) *Dot

AddMap adds key to current dot d and adds content below this key using given variadic string-maps

func (*Dot) AddStringS

func (d *Dot) AddStringS(key string, val ...[]string) *Dot

AddStringS adds key to current dot d and adds content below this key using given variadic string-slices

func (*Dot) AddStrings

func (d *Dot) AddStrings(key string, val ...string) *Dot

AddStrings adds key to current dot d and adds content below this key using given variadic strings

func (*Dot) AssignMs

func (d *Dot) AssignMs(val ...map[string]string) *Dot

AssignMs adds to (or replaces with) content below current dot d using given variadic string-maps

func (*Dot) AssignSs

func (d *Dot) AssignSs(val ...[]string) *Dot

AssignSs adds to (or replaces with) content below current dot d using given variadic string-slices

func (*Dot) Assignss

func (d *Dot) Assignss(vals ...string) *Dot

Assignss adds to (or replaces with) content below current dot d using given variadic strings

func (*Dot) DeleteMs

func (d *Dot) DeleteMs(vals ...map[string]string) *Dot

DeleteMs deletes / removes content below current dot d using given variadic string-maps

func (*Dot) DeleteSs

func (d *Dot) DeleteSs(vals ...[]string) *Dot

DeleteSs deletes / removes content below current dot d using given variadic string-slices

func (*Dot) Deletess

func (d *Dot) Deletess(vals ...string) *Dot

Deletess deletes / removes content below current dot d using given variadic strings

func (*Dot) G

func (d *Dot) G(keys ...string) *Dot

G is a helper method for templates: Go down into (eventually new!) key(s) and return the final child dot (key).

func (*Dot) KV

func (d *Dot) KV(key, val string) *Dot

KV is a helper method for templates: Assign Key & Value to current dot.

func (*Dot) Set

func (d *Dot) Set(vals ...string) *Dot

Set adds (or replaces) content below current dot d using given variadic strings

func (*Dot) SetM

func (d *Dot) SetM(val ...map[string]string) *Dot

SetM adds (or replaces) content below current dot d using given variadic string-maps

func (*Dot) SetS

func (d *Dot) SetS(val ...[]string) *Dot

SetS adds (or replaces) content below current dot d using given variadic string-slices

func (*Dot) UnlockedAdd

func (d *Dot) UnlockedAdd(key string, val ...string) (interface{}, bool)

UnlockedAdd is a helper method and is exported only for use by the function library "do/dot". It adds key to d, and adds variadic strings below key, and returns child "key"

Note: It's 2nd arg (bool) intentionally avoids usage from templates!

Other clients must behave as if this method is not exported!

func (*Dot) UnlockedGet

func (d *Dot) UnlockedGet(key string) (interface{}, bool)

UnlockedGet is a helper method and is exported only for use by the function library "do/dot". It returns the (eventually new!) child (key)

Note: It's 2nd arg (bool) intentionally avoids usage from templates!

Other clients must behave as if this method is not exported!

type DotS

type DotS []Friendly

DotS implements sort.Interface

func (DotS) Len

func (k DotS) Len() int

Len implements sort.Interface

func (DotS) Less

func (k DotS) Less(i, j int) bool

Less implements sort.Interface

func (DotS) Swap

func (k DotS) Swap(i, j int)

Swap implements sort.Interface

type Friendly

type Friendly interface {
	tag.Friendly   // via "container/.../tag/..."
	lsm.Friendly   // via "container/.../lsm"
	StringFriendly // dot.go: Set..., Assign..., Delete...
	ChildFriendly  // children.go: lookupDot getChild
	/*
		NavigatorFriendly   // navigate.go: Up Root Path DownS
		PrinterFriendly     // print.go: PrintTree
		ErrorFriendly       // => dot!	error.go
		OutputFriendly      // output.go
	*/
	GoFriendly // dot.go

}

Friendly - interface exposed for go doc only shows the composition as interface

type GoFriendly

type GoFriendly interface {
	// helper for templates:
	A(vals ...string) string // Add values, and return an empty string
	G(keys ...string) *Dot   // Go into key(s)
	KV(key, val string) *Dot // Assign a Key Value Pair
	// helper for "do/dot"
	UnlockedGet(key string) (interface{}, bool)
	UnlockedAdd(key string, val ...string) (interface{}, bool)
}

GoFriendly - interface exposed for go doc only

type PrivacyFriendly

type PrivacyFriendly interface {
	// contains filtered or unexported methods
}

PrivacyFriendly - interface exposed for go doc only

type SetableFriendly

type SetableFriendly interface {
	Set(vals ...string) *Dot            // Set/replace Content with val - given as strings
	SetS(val ...[]string) *Dot          // Set/replace Content with val - given as slices of strings
	SetM(val ...map[string]string) *Dot // Set/replace Content with val - given as maps of strings
}

SetableFriendly - interface exposed for go doc only

type StringFriendly

type StringFriendly interface {
	SetableFriendly // set.go: Set/replace Content: Set SetS SetM
	AssignFriendly  // assign.go: Add/overwrite Content: Assignss AssignSs AssignMs
	UserFriendly    // add.go: AddMap AddStrings AddStringS
	DeleteFriendly  // delete.go: Delete/remove vals from Content: Deletes, DeleteS, DeleteM
	PrivacyFriendly // content.go: add addM

}

StringFriendly - interface exposed for go doc only

type UserFriendly

type UserFriendly interface {
	AddStrings(key string, val ...string) *Dot         // adds key to d, and adds variadic strings below key
	AddStringS(key string, val ...[]string) *Dot       // adds key to d, and adds slices below key
	AddMap(key string, vals ...map[string]string) *Dot // adds key to d, and adds map(s) below key
}

UserFriendly - interface exposed for go doc only

Jump to

Keyboard shortcuts

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