lib

package
v0.0.0-...-179f7ef Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2019 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUCCESS             = "success"
	FAILURE             = "failure"
	BATCH_TASK_PENDING  = "1"
	BATCH_TASK_COMPLETE = "2"
	SIGNING_KEY         = "wYu8P1UBnyI7QhGXg2YNqY"
	ERROR_UNEXPECTED    = "Unexpected Error."
	STRING_SMALL        = "STRING_SMALL"
	STRING_LARGE        = "STRING_LARGE"
	STRING_MID          = "STRING_MID"
	STRING_BIG          = "STRING_BIG"
	STRING_NAME         = "STRING_NAME"
	STRING_EMAIL        = "STRING_EMAIL"
	STRING_PASSWORD     = "STRING_PASSWORD"
	STRING_ACTION_NAME  = "STRING_ACTION_NAME"
	INT                 = "INT"
	INT_ACCESS_LEVEL    = "INT_ACCESS_LEVEL"
	INT_BOOLEAN         = "INT_BOOLEAN"
	ID                  = "ID"
	EMAIL               = "EMAIL"
	PASSWORD            = "PASSWORD"
)

Variables

This section is empty.

Functions

func CheckAuth

func CheckAuth(tokenString string) (string, error)

func CreateDBConnection

func CreateDBConnection() (*gorm.DB, error)

func CreateNATSConnection

func CreateNATSConnection() (*nats.Conn, error)

func GetAPIKey

func GetAPIKey(tokenString string) (string, error)

func GetLogger

func GetLogger() gokitlog.Logger

func PostNotificationToHttpBin

func PostNotificationToHttpBin(logger log.Logger, url string, jsonStr map[string]string, chJob chan string, chRresult chan string)

func ValidateJWTToken

func ValidateJWTToken(tokenString string, tokenSecret string) (*jwt.Token, error)

Types

type CommonService

type CommonService struct {
	Logger log.Logger
	// contains filtered or unexported fields
}

func (CommonService) ErrorResponseHelper

func (c CommonService) ErrorResponseHelper(w http.ResponseWriter, errorCode string, errorMessage string, httpStatus int)

func (CommonService) GetUserClientFromToken

func (c CommonService) GetUserClientFromToken(r *http.Request) (string, error)

func (CommonService) MockTestServer

func (c CommonService) MockTestServer(method string, url string, jsonInput []byte) (*httptest.ResponseRecorder, *http.Request)

func (CommonService) SuccessResponseHelper

func (c CommonService) SuccessResponseHelper(w http.ResponseWriter, class interface{}, httpStatus int)

func (CommonService) SuccessResponseList

func (c CommonService) SuccessResponseList(w http.ResponseWriter, class interface{}, offset string, limit string, count string)

func (CommonService) ValidateId

func (c CommonService) ValidateId(id string, fieldName string) error

func (CommonService) ValidateInputParameters

func (c CommonService) ValidateInputParameters(r *http.Request, paramConf map[string]models.ParamConf, pathParamConf map[string]string) (map[string]string, map[string]interface{}, string, error)

func (CommonService) ValidateQueryString

func (c CommonService) ValidateQueryString(r *http.Request, defaultLimit string, defaultOffset string, defaultOrderby string, defaultSort string) (string, string, string, string, error)

Jump to

Keyboard shortcuts

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