utils

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: GPL-3.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTypeNotSupport = errors.New("Type not supported")
	ErrIPInvalid      = errors.New("Invalid IP address")
)

Functions

func ConvertKeyToId

func ConvertKeyToId(key string) string

func GenericListContainItem

func GenericListContainItem(elem interface{}, elems []interface{}) bool

func LoadStructureFromYamlFile

func LoadStructureFromYamlFile(folder string, filePath string, data interface{}) (interface{}, error)

func NewUID

func NewUID() string

func ReplaceQuestionUnrelated

func ReplaceQuestionUnrelated(val string) (string, error)

func RestParseRequest

func RestParseRequest(w http.ResponseWriter, r *http.Request, res interface{}) error

func RestParseResponse

func RestParseResponse(w http.ResponseWriter, r *http.Request, req interface{}) error

func SaveStructureToYamlFile

func SaveStructureToYamlFile(folder string, filePath string, data interface{}) error

func StringsListContainItem

func StringsListContainItem(elem string, elems []string, ignoreCase bool) bool

func StructToString

func StructToString(i interface{}) string

func StructureToJson

func StructureToJson(itf interface{}) ([]byte, error)

Types

type FileIndex

type FileIndex struct {
	Path  string
	Size  int64
	Index int
}

func FileToIndex

func FileToIndex(path string, extension string) (FileIndex, error)

type Printable

type Printable interface {
	String() string
}

Jump to

Keyboard shortcuts

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