data

package
v0.2.0-beta Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACCOUNT_BLOCKCHAIN_ADDRESS = 1
	ACCOUNT_FIRST_NAME         = 3
	ACCOUNT_LAST_NAME          = 4
	ACCOUNT_YOB                = 5
	ACCOUNT_LOCATION           = 6
	ACCOUNT_GENDER             = 7
	ACCOUNT_COMMODITIES        = 8
	ACCOUNT_ACTIVE_VOUCHER     = 17
)

Subset of urdt/ussd/common specifically for syncing to the central data store i.e Graph. TODO: Replace with imported data types from the common package once lib-gdbm dependency is removed.

Variables

View Source
var ValidDataTypeLookup = map[uint16]string{
	ACCOUNT_BLOCKCHAIN_ADDRESS: "blockchain_address",
	ACCOUNT_FIRST_NAME:         "first_name",
	ACCOUNT_LAST_NAME:          "last_name",
	ACCOUNT_YOB:                "yob",
	ACCOUNT_LOCATION:           "location_name",
	ACCOUNT_GENDER:             "gender",
	ACCOUNT_COMMODITIES:        "commodities",
	ACCOUNT_ACTIVE_VOUCHER:     "active_voucher",
}

ValidDataTypeLookup allows us to filter go-vise data types, additionally the value maps to the ussd_data coulmn

Functions

func DecodeKey

func DecodeKey(key []byte) (uint16, string)

DecodeKey specifically only decodes user data keys stored as bytes into its respective session ID and data type TODO: Replace return data type with imported data types from the common package once lib-gdbm dependency is removed.

func DecodeValue

func DecodeValue(v []byte) string

DecodeValue returns the utf-8 string representation of the value stored in the storage backend

func EncodeKey

func EncodeKey(sessionID string, dataType uint16) []byte

EncodeKey returns the byte representation of a urdt/ussd user data key. This key can be used to lookup the value on any storage backend implementation. Warning: This is a shortcut specifically for user data, it is not expected to work for all go-vise keys. TODO: Replace with imported data types from the common package once lib-gdbm dependency is removed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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