util

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentTime

func GetCurrentTime() int64

GetCurrentTime returns current timestamp

func ParseTemplate

func ParseTemplate(name string, template string, variables map[string]string) (string, error)

ParseString is used to get body according to template

func Request

func Request(options Option) ([]byte, error)

Request is used to do a post request

Types

type Option

type Option struct {
	Protocol string            `json:"protocol"`
	Host     string            `json:"host"`
	Path     string            `json:"path"`
	Method   string            `json:"method"`
	Headers  map[string]string `json:"headers"`
	Body     interface{}       `json:"body"`
}

Option is used to post request

Jump to

Keyboard shortcuts

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