tools

package
v0.0.0-...-fca878f Latest Latest
Warning

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

Go to latest
Published: May 25, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Verbose = true

Verbose flag to switch verbose

Functions

func Dumper

func Dumper(infos ...interface{})

Dumper verbose logs

Types

type DevelTester

type DevelTester struct {
}

DevelTester for the setup of ginkgo test

func (DevelTester) Config

func (h DevelTester) Config() *configs.ParameterConfig

Config set up the config for testing from envt

func (DevelTester) EmptyDBTst

func (h DevelTester) EmptyDBTst(storage *gorm.DB)

EmptyDBTst free the test db

type HTTPCurl

type HTTPCurl struct {
	HTTPClient *http.Client
	Timeout    time.Duration
}

HTTPCurl helpers for http requests

func NewHTTPCurl

func NewHTTPCurl() *HTTPCurl

NewHTTPCurl new http helper object

func (*HTTPCurl) Get

func (g *HTTPCurl) Get(url string) (string, int, error)

Get request via get

func (*HTTPCurl) Init

func (g *HTTPCurl) Init()

Init start prep

type Helper

type Helper struct {
}

Helper utility

func (Helper) FormatSliceToIntMap

func (h Helper) FormatSliceToIntMap(all []int) map[int]int

FormatSliceToIntMap convert slice of int to map

func (Helper) HashMD5

func (h Helper) HashMD5(s string) string

HashMD5 generate md5 string

func (Helper) RemoveIntDuplicates

func (h Helper) RemoveIntDuplicates(elements []int) []int

RemoveIntDuplicates de-duplicate int list

func (Helper) RemoveStrDuplicates

func (h Helper) RemoveStrDuplicates(elements []string) []string

RemoveStrDuplicates de-duplicate string list

func (Helper) UUID

func (h Helper) UUID() string

UUID random uuid

type PagingParams

type PagingParams struct {
	Page  int `json:"page"`
	Limit int `json:"limit"`
	Total int `json:"total,omitempty"`
}

PagingParams paging details from req-parameters

func NewPagingParams

func NewPagingParams(r *http.Request) *PagingParams

NewPagingParams parse paging

type Seeder

type Seeder struct {
}

Seeder generator of dummy data

func (Seeder) Create

func (s Seeder) Create() string

Create geneate dummy building-data

func (Seeder) CreateFloors

func (s Seeder) CreateFloors() []string

CreateFloors generate random floor list

func (Seeder) CreateMin

func (s Seeder) CreateMin() string

CreateMin geneate dummy building-data and with only name

func (Seeder) CreateWithEmptyName

func (s Seeder) CreateWithEmptyName() string

CreateWithEmptyName geneate dummy building-data with empty name

func (Seeder) CreateWithName

func (s Seeder) CreateWithName(name string) string

CreateWithName geneate dummy building-data and with name

func (Seeder) Update

func (s Seeder) Update(pid int64, name string) string

Update geneate dummy building-data with an ID from parameter

Jump to

Keyboard shortcuts

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