Documentation ¶
Overview ¶
Package data_type defines the generic data types used in SDS.
Supported data types are:
- Queue is the list where the new element is added to the end, but when an element is taken its taken from the top. Queue doesn't allow addition of any kind of element. All elements should have the same type.
- Key_value different kinds of maps
- serialize functions to serialize any structure to the bytes and vice versa.
Package data_type defines the generic data types used in SDS.
Supported data types are:
- Queue is the list where the new element is added to the end, but when an element is taken its taken from the top. Queue doesn't allow addition of any kind of element. All elements should have the same type.
- Key_value different kinds of maps
- serialize functions to serialize any structure to the bytes and vice versa.
Index ¶
- Constants
- func AddJsonPrefix(bytes []byte) string
- func DecodeJsonPrefixed(str string) string
- func Deserialize(bytes []byte, body interface{}) error
- func IsJsonPrefixed(str string) bool
- func IsNil(v interface{}) bool
- func IsPointer(body interface{}) bool
- func Serialize(body interface{}) ([]byte, error)
- type Queue
Constants ¶
const QueueCap uint = 10
Variables ¶
This section is empty.
Functions ¶
func AddJsonPrefix ¶
func DecodeJsonPrefixed ¶
func Deserialize ¶
Deserialize the given string to the map, slice or struct.
func IsJsonPrefixed ¶
Types ¶
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
func NewQueue ¶
func NewQueue() *Queue
NewQueue returns the queue of the elements that could contain maximum QUEUE_LENGTH number of elements.
The queue has a function that returns the first element by taking it out from the list.
The added elements attached after the last element.
func (*Queue) First ¶
func (q *Queue) First() interface{}
First returns the first element without removing it from the queue If there is no element, then returns nil
func (*Queue) Pop ¶
func (q *Queue) Pop() interface{}
Pop takes the first element from the list and returns it. If there is no element in the list, then return nil
Directories ¶
Path | Synopsis |
---|---|
Package database keeps the utility functions that converts database type to internal golang type
|
Package database keeps the utility functions that converts database type to internal golang type |
Package key_value defines the custom map and its additional functions.
|
Package key_value defines the custom map and its additional functions. |