github.com/nikandfor/tlog@v0.21.5-0.20231108111739-3ef89426a96d/tlwire/wire.go (about)

     1  package tlwire
     2  
     3  // Basic types.
     4  const (
     5  	Int = iota << 5
     6  	Neg
     7  	Bytes
     8  	String
     9  	Array
    10  	Map
    11  	Semantic
    12  	Special
    13  
    14  	TagMask    = 0b111_00000
    15  	TagDetMask = 0b000_11111
    16  )
    17  
    18  // Len.
    19  const (
    20  	Len1 = 24 + iota
    21  	Len2
    22  	Len4
    23  	Len8
    24  	_
    25  	_
    26  	_
    27  	LenBreak = Break
    28  )
    29  
    30  // Specials.
    31  const (
    32  	False = 20 + iota
    33  	True
    34  	Nil
    35  	Undefined
    36  
    37  	Float8
    38  	Float16
    39  	Float32
    40  	Float64
    41  	_
    42  	_
    43  	_
    44  	Break
    45  
    46  	None    = 19 // used to preserve padding
    47  	Hidden  = 18 // passwords, etc. when you want to preserve the key
    48  	SelfRef = 17 // self reference
    49  )
    50  
    51  // Semantics.
    52  const (
    53  	Meta = iota
    54  	Error
    55  	Time
    56  	Duration
    57  	Big
    58  
    59  	Caller
    60  	_
    61  	Hex
    62  	_
    63  	_
    64  
    65  	SemanticTlogBase
    66  )
    67  
    68  func init() {
    69  	if Break != TagDetMask {
    70  		panic(Break)
    71  	}
    72  }