godao

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-dao

Data Access Object

My personal variable types in Golang. All of which is just an extension and made it simpler to create objects and converting them to other types

warning: this is meant for my own resuble utilities, that i use a lot, and making it available for me to import via go modules

  • Map (map[string]any with extra features: access by json path, encode-to-from json/msgpack)
  • Array (making array methods similiar to js array)
  • Bytes ([]bytes, with value conversion methods)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JsonDecode

func JsonDecode(data []byte, v any) (err error)

func JsonEncode

func JsonEncode(v any, pretty ...bool) (data []byte)

func MsgDecode

func MsgDecode(data []byte, v any) (err error)

func NewArrayType

func NewArrayType[T comparable](initialValue ...T) (arr *dao.Arr[T])

generic array

func NewMap

func NewMap() dao.Map

Types

type Array

type Array = dao.Arr[any]

Array is a dynamic type of array

func NewArray

func NewArray(initialValue ...[]any) *Array

create a new Array.

type Bytes

type Bytes = bytesvalue.Bytes

type Float

type Float = bytesvalue.Float

type Int

type Int = bytesvalue.Int

type Map

type Map = dao.Map

type RawValue

type RawValue = json.RawValue

func MsgEncode

func MsgEncode(v any, pretty ...bool) (data RawValue, err error)

type StringArray

type StringArray = dao.Arr[string]

example of speficic type of array

Directories

Path Synopsis
encoding
msg
internal
dao
Package match provides a simple pattern matcher with unicode support.
Package match provides a simple pattern matcher with unicode support.
dao/dutils
Package utils provides common utility functions.
Package utils provides common utility functions.

Jump to

Keyboard shortcuts

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