Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { NodeType Node `json:"node_type"` NodeName string `json:"node_name"` Path string `json:"path"` LibPath string `json:"lib_path"` Mode MODE `json:"mode"` Port int `json:"port"` SecretKey string `json:"secret_key"` DB DB `json:"db"` DBPath string `json:"db_path"` DBName string `json:"db_name"` DBHost string `json:"db_host"` DBPort int `json:"db_port"` DBUser string `json:"db_user"` DBPass string `json:"db_pass"` DBSsl string `json:"db_ssl"` RabbitMq bool `json:"-"` RabbitMqHost string `json:"rabbitmq_host"` RabbitMqPort int `json:"rabbitmq_port"` RabbitMqUser string `json:"rabbitmq_user"` RabbitMqPass string `json:"rabbitmq_pass"` Redis bool `json:"-"` RedisHost string `json:"redis_host"` RedisPort int `json:"redis_port"` RedisPass string `json:"redis_pass"` RedisDB int `json:"redis_db"` ChannelName string `json:"channel_name"` Versioning bool `json:"versioning"` Scheduler string `json:"scheduler"` }
Config Application config structure
type DB ¶
type DB string
DB enum type
const Postgres DB = "postgres"
Postgres Enum
const Unknown DB = "unknown"
Unknown enum. This enum just test mode
type Dir ¶
type Dir struct { Path string `json:"path"` Name string `json:"name"` Mode interface{} `json:"mode"` Size int64 `json:"size"` ModTime time.Time `json:"mod_time"` }
Dir lib path dir info structure
type LoginRequest ¶
type LoginRequest struct { ID string `json:"id" validate:"required"` Password string `json:"password" validate:"required"` }
LoginRequest api login request structure
type LoginResponse ¶
type LoginResponse struct { PassphraseID int64 `json:"passphrase_id"` UserID int64 `json:"user_id"` Passphrase string `json:"passphrase"` }
LoginResponse api login success response
type MODE ¶
type MODE string
MODE type for application
const Dev MODE = "dev"
Dev Development mode enum
const Prod MODE = "prod"
Prod Production model enum
const Test MODE = "test"
Test mode enum
type Pagination ¶
type Pagination struct { Model Limit int `validate:"lte=40"` Offset int64 OrderBy string `validate:"oneof=asc desc"` OrderField string }
Pagination request pagination field parser
func NewPagination ¶
func NewPagination() Pagination
NewPagination generate pagination struct with default values
type ReceivedMessage ¶
ReceivedMessage queuing messasge payload
func NewReceivedMessage ¶
func NewReceivedMessage(str ...string) *ReceivedMessage
NewReceivedMessage building queuing message
type ResponseError ¶
type ResponseError struct { ResponseInterface `json:"-"` Errors interface{} `json:"errors"` Detail string `json:"detail"` }
ResponseError rest api error response structure
func (ResponseError) ToJSON ¶
func (r ResponseError) ToJSON() string
ToJSON response structure to json string
type ResponseInterface ¶
type ResponseInterface interface {
ToJSON() string
}
ResponseInterface rest api response interface
type ResponseSuccess ¶
type ResponseSuccess struct { ResponseInterface `json:"-"` Data interface{} `json:"data"` TotalCount int64 `json:"total_count"` }
ResponseSuccess rest api success response structure
func (ResponseSuccess) ToJSON ¶
func (r ResponseSuccess) ToJSON() string
ToJSON response structure to json string
type ResponseSuccessOne ¶
type ResponseSuccessOne struct { ResponseInterface `json:"-"` Data interface{} `json:"data"` }
ResponseSuccessOne rest api success response structure
func (ResponseSuccessOne) ToJSON ¶
func (r ResponseSuccessOne) ToJSON() string
ToJSON response structure to json string
type ResponseToken ¶
type ResponseToken struct { ResponseInterface `json:"-"` JWT string `json:"jwt"` UserID int64 `json:"user_id"` }
ResponseToken JWT auth response
func (ResponseToken) ToJSON ¶
func (r ResponseToken) ToJSON() string
ToJSON JWT auth struct to json string
type TokenRequest ¶
type TokenRequest struct {
Passphrase string `json:"passphrase" validate:"required"`
}
TokenRequest api token request structure