Documentation
¶
Overview ¶
Package types implements encoding/decoding interfaces for generic, asn1 compatible types.
Index ¶
- Constants
- Variables
- func FactorType(typeID int32) (interface{}, error)
- func MakeByteSlice(size int, capacity ...int) []byte
- func Marshal(i Factory) ([]byte, error)
- func RegisterType(f Factory)
- func Unmarshal(d []byte) (interface{}, error)
- type ByteSliceMaker
- type Factory
- type RatchetPublicKey
- type TimeKey
Constants ¶
View Source
const Version = int32(1000000001)
Version is this library's version.
Variables ¶
Functions ¶
func FactorType ¶
FactorType returns a variable of type typeID.
func MakeByteSlice ¶
func RegisterType ¶
func RegisterType(f Factory)
RegisterType registers a type with this library. It must be called during the type's module init function.
Types ¶
type ByteSliceMaker ¶
type Factory ¶
type Factory interface { TypeID() int32 // TypeID returns the _unique_ TypeID of this type. Must return a value greater than 0. New() interface{} // New returns a new instance of the type, as a pointer value. }
Factory is the interface that needs to be implemented by each type handled by this library.
type RatchetPublicKey ¶
RatchetPublicKey is a public key (list) of a ratchet key.
func (*RatchetPublicKey) SelectKey ¶
func (self *RatchetPublicKey) SelectKey(time int64) *TimeKey
func (*RatchetPublicKey) SelectKeyRange ¶
func (self *RatchetPublicKey) SelectKeyRange(begin, end int64) []TimeKey
Click to show internal directories.
Click to hide internal directories.