helper

package
v0.0.0-...-c60e208 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Basic = iota
	Bearer
)

const of token type

Variables

This section is empty.

Functions

func CheckErr

func CheckErr(err error)

func ConvertStringToInt

func ConvertStringToInt(text string) int

func DeepEqual

func DeepEqual(x, y interface{}) bool

func Delete

func Delete(requestModel RequestModel, result *interface{}) error

Delete request

func Get

func Get(requestModel RequestModel, result *interface{}) error

Get request

func GetAppConfig

func GetAppConfig() *config.Configuration

func GetError

func GetError(status int, messageType string) error

func GetParams

func GetParams(key interface{}) []string

func HandleError

func HandleError(message string) error

func MapResponse

func MapResponse(conv merp.ConventionalMarshaller) (interface{}, error)

func NewSchema

func NewSchema(queryType *graphql.Object, mutationType *graphql.Object) graphql.Schema

func Post

func Post(requestModel RequestModel, result *interface{}) error

Post request

func Put

func Put(requestModel RequestModel, result *interface{}) error

Put request

func Readfile

func Readfile(path string) (string, error)

func ReplaceLine

func ReplaceLine(path, key, newValue string) error

func SetAppConfig

func SetAppConfig(data *config.Configuration)

func SetErrorList

func SetErrorList(data *config.ErrorDict)

func Str2IdStrs

func Str2IdStrs(str string, splitChar string) ([]string, error)

func Str2Ids

func Str2Ids(str string, splitChar string) ([]int, error)

func WriteFile

func WriteFile(path string, json string) error

Types

type ConventionalMarshaller

type ConventionalMarshaller struct {
	Value interface{}
}

func (*ConventionalMarshaller) MarshalJSON

func (c *ConventionalMarshaller) MarshalJSON() ([]byte, error)

type PathModel

type PathModel struct {
	Name  string
	Path  string
	Ext   string
	Alias string
}

func ReadDeepDir

func ReadDeepDir(path string, isOnlyFile bool) ([]PathModel, error)

func ReadDir

func ReadDir(path string, isOnlyFile bool) ([]PathModel, error)

type RequestModel

type RequestModel struct {
	URL       string
	TokenType TokenType
	Token     string
	Username  string
	Password  string
	Body      string
}

RequestModel model

type TokenType

type TokenType int8

TokenType type of token

func (TokenType) String

func (s TokenType) String() string

Jump to

Keyboard shortcuts

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