shared

package
v0.0.0-...-3eef48c Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrorDataNotFound error message when data doesn't exist
	ErrorDataNotFound = "data %s not found"
	// ErrorParameterInvalid error message for parameter is invalid
	ErrorParameterInvalid = "%s parameter is invalid"
	// ErrorParameterRequired error message for parameter is missing
	ErrorParameterRequired = "%s parameter is required"
	// ErrorParameterLength error message for parameter length is invalid
	ErrorParameterLength = "length of %s parameter exceeds the limit %d"
	// ErrorUnauthorized error message for unauthorized user
	ErrorUnauthorized = "you are not authorized"

	// ErrorRedisNil error for redis nil
	ErrorRedisNil = "redis: nil"
)

Variables

View Source
var AllowedSortFields = []string{
	"name",
	"id",
	"created",
	"last_modified",
}

AllowedSortFields is allowed field name for sorting

Functions

func StringInSlice

func StringInSlice(str string, list []string) bool

StringInSlice function for checking whether string in slice str string searched string list []string slice

Types

type BaseDomain

type BaseDomain struct {
	CreatedAt time.Time `gorm:"column:created_at"`
	UpdatedAt time.Time `gorm:"column:updated_at"`
}

BaseDomain structure

type ErrorAllowNumericOnly

type ErrorAllowNumericOnly struct {
	// contains filtered or unexported fields
}

ErrorAllowNumericOnly struct

func NewErrorAllowNumericOnly

func NewErrorAllowNumericOnly(field string) *ErrorAllowNumericOnly

NewErrorAllowNumericOnly ErrorRatingExceedLimit's constructor

func (*ErrorAllowNumericOnly) Error

func (e *ErrorAllowNumericOnly) Error() string

Error function

type ErrorValueShouldBool

type ErrorValueShouldBool struct {
	// contains filtered or unexported fields
}

ErrorValueShouldBool struct

func NewErrorValueShouldBool

func NewErrorValueShouldBool(field string) *ErrorValueShouldBool

NewErrorValueShouldBool ErrorValueShouldBool's constructor

func (*ErrorValueShouldBool) Error

func (e *ErrorValueShouldBool) Error() string

Error function

type Output

type Output struct {
	Result interface{}
	Err    error
}

Output struct

type Parameters

type Parameters struct {
	StrPage        string
	Page           int
	StrLimit       string
	Limit          int
	Offset         int
	IsDeleteString string
	IsDelete       bool
	Sort           string
	OrderBy        string
	DateFrom       string
	DateTo         string
	ID             int
	Query          string
}

Parameters data structure

Jump to

Keyboard shortcuts

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