app

package
v0.0.0-...-9e59f10 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

DB connection

Functions

func CloseDatabase

func CloseDatabase()

CloseDatabase closing database connection

func ConnectDatabase

func ConnectDatabase()

ConnectDatabase method to connect with db

func ConnectDatabaseTest

func ConnectDatabaseTest()

ConnectDatabaseTest method for testing

Types

type APIResult

type APIResult interface {
	Success(c *gin.Context, res interface{})
	Error(c *gin.Context, code int, description string)
}

APIResult output

func NewAPIResult

func NewAPIResult() APIResult

NewAPIResult instance for APIResult

type Result

type Result struct {
	Code        int         `json:"code"`
	Description interface{} `json:"description,omitempty"`
	Result      interface{} `json:"result"`
}

Result untuk json response

func (*Result) Error

func (r *Result) Error(c *gin.Context, code int, description string)

Error api result

func (*Result) Success

func (r *Result) Success(c *gin.Context, res interface{})

Success api result

Directories

Path Synopsis
Code generated by go-queryset.
Code generated by go-queryset.
Code generated by router_generator.
Code generated by router_generator.

Jump to

Keyboard shortcuts

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