Documentation ¶
Overview ¶
Package id List is responsible for id List managing
Package id List is responsible for id List managing ¶
Package id List is responsible for id List managing
Index ¶
- Variables
- func ConditionalFilePath(fn string) string
- func ScZero(SrcZ string, cmd *flag.FlagSet) error
- func SubCmdReNewList() (err error)
- func SubCmdRefreshList() (err error)
- func SubCmdUpdate() error
- func ZeroSourceTreeIds(srcRoot string, run bool)
- type ArrayFlag
- type TriceFmt
- type TriceFmtLookUp
- type TriceID
- type TriceIDLookUp
Constants ¶
This section is empty.
Variables ¶
var ( // Verbose gives mor information on output if set. The value is injected from main packages. Verbose bool // DryRun if set, inhibits real changes DryRun bool // FnJSON is the filename for the JSON formatted ID list. FnJSON string // MinShort is the smallest allowed ID for short trices. MinShort = TriceID(1) // MaxShort is the biggest allowed ID for short trices. MaxShort = TriceID(32767) // Min is the smallest allowed ID for normal trices. Min = TriceID(32768) // Max is the biggest allowed ID for normal trices. Max = TriceID(65535) // SearchMethod is the next ID search method. SearchMethod = "random" // SharedIDs false: TriceFmt's without TriceID get a different TriceID if an equal TriceFmt exists already. SharedIDs = true )
Functions ¶
func ConditionalFilePath ¶ added in v0.10.0
ConditionalFilePath returns absolute file path if fn is not "off" or "none".
func SubCmdReNewList ¶ added in v0.18.4
func SubCmdReNewList() (err error)
SubCmdReNewList renews the trice id list parsing the source tree without changing any source file. It creates a new FnJSON and tries to add id:tf pairs from the source tree. If equal tf are found with different ids they are all added. If the same id is found with different tf only one is added. The others are reported as warning. If any TRICE* is found without Id(n) or with Id(0) it is ignored. SubCmdUpdate needs to know which IDs are used in the source tree to reliable add new IDs.
func SubCmdRefreshList ¶ added in v0.18.4
func SubCmdRefreshList() (err error)
SubCmdRefreshList refreshes the trice id list parsing the source tree without changing any source file. It only reads FnJSON and tries to add id:tf pairs from the source tree. If equal tf are found with different ids they are all added. If the same id is found with different tf only one is added. The others are reported as warning. If any TRICE* is found without Id(n) or with Id(0) it is ignored. SubCmdUpdate needs to know which IDs are used in the source tree to reliable add new IDs.
func ZeroSourceTreeIds ¶ added in v0.10.0
ZeroSourceTreeIds is overwriting with 0 all id's from source code tree srcRoot. It does not touch idlist.
Types ¶
type ArrayFlag ¶ added in v0.10.0
type ArrayFlag []string
ArrayFlag is a slice type for multi flag
var ( // Srcs gets multiple files or directories. Srcs ArrayFlag )
type TriceFmt ¶ added in v0.18.4
type TriceFmt struct { Type string `json:"Type"` // format type (bitsize and number of fmt string parameters) Strg string `json:"Strg"` // format string }
TriceFmt is the trice format information assigned to a trice ID.
type TriceFmtLookUp ¶ added in v0.18.4
TriceFmtLookUp is the TriceFmt-to-ID info translation map. Equal TriceFmt cannot have different IDs in this translation map.
It is derived from IDLookUp reversing it and can be used during SharedUpdate of src tree. Example: A:1, !C:5, C:7 (C.7 will overwrite C:5) If in source code equal TriceFmt's have different IDs they are not touched. If an additional equal TriceFmt occures without ID it gets one of the already for this format string used IDs. This is the default. For forcing different IDs on equal Fmt's a SolitaryUpdate function is needed. (to do)
type TriceID ¶ added in v0.18.4
type TriceID int
TriceID is the trice ID referencing to Fmt.
type TriceIDLookUp ¶ added in v0.18.4
TriceIDLookUp is the ID-to-TriceFmt info translation map. Different IDs can refer to equal TriceFmt's. It is used during logging. Example: 1:A, 5:C, 7:C An ID can point to one and only format string.
func NewLut ¶ added in v0.18.4
func NewLut(fn string) TriceIDLookUp
NewLut returns a look-up map generated from JSON map file named fn.
func (TriceIDLookUp) FileWatcher ¶ added in v0.18.4
func (lu TriceIDLookUp) FileWatcher(m *sync.RWMutex)
FileWatcher checks id List file for changes taken from https://medium.com/@skdomino/watch-this-file-watching-in-go-5b5a247cf71f
func (TriceIDLookUp) FromJSON ¶ added in v0.18.4
func (lu TriceIDLookUp) FromJSON(b []byte) (err error)
FromJSON converts JSON byte slice to lu.