util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenUniqueID

func GenUniqueID() string

Generate Unique ID Currently using ULID, this maybe conflict with other process with very low possibility

func ParseMultipartForm

func ParseMultipartForm(r *http.Request) ([][2]string, error)

Parse the multipart/form-data in request. Unlike the canonical http.Request.ParseMultipartForm which returns a `map[string][]string` form values, we would like to parse the form data into a [][2]string, so to keep the order of the key/value pairs in the body. as we would use this parser to get a list of messages.

NOTE: this only implements partial of the multipart/form-data protocol. we don't parse the filename parts of file uploading through form.

func WithRecover

func WithRecover(logger *logrus.Logger, funcs ...func())

func ZKCreateEphemeralPath

func ZKCreateEphemeralPath(c *zk_wrapper.Conn, zkPath string, data []byte) error

func ZKCreatePersistentPath

func ZKCreatePersistentPath(c *zk_wrapper.Conn, zkPath string, data []byte) error

func ZKCreateRecursive

func ZKCreateRecursive(c *zk_wrapper.Conn, zkPath string, flags int32, data []byte) error

ZKCreateRecursive creates the zkPath recursively if it does not exist.

func ZKSetPersistentPath

func ZKSetPersistentPath(c *zk_wrapper.Conn, zkPath string, data []byte) error

ZKSetPersistentPath writes data to the node specified by zkPath. zkPath will be created recursively if it does not exist in zookeeper.

Types

This section is empty.

Jump to

Keyboard shortcuts

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