common

package
v0.0.0-...-7240a86 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Overview

Copyright 2019 Septian Wibisono

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const DATABASE_EXEC_FAIL_CODE = 2200
View Source
const FORBIDDEN_CODE = 2103
View Source
const INPUT_VALIDATION_FAIL_CODE = 2110
View Source
const MODULE_OPERATION_FAIL_CODE = 2102
View Source
const NOT_ACCEPTABLE_CODE = 2112
View Source
const PAGE_NOT_FOUND_CODE = 2100
View Source
const RECORD_NOT_FOUND_CODE = 2230
View Source
const UNKNOWN_ERROR_CODE = 2101

Variables

View Source
var NOT_ACCEPTABLE = gin.H{"code": NOT_ACCEPTABLE_CODE, "message": "You are trying to request something not acceptible here."}
View Source
var PAGE_NOT_FOUND = gin.H{"code": PAGE_NOT_FOUND_CODE, "message": "You are find something we can't found it here."}
View Source
var RECORD_NOT_FOUND = gin.H{"code": RECORD_NOT_FOUND_CODE, "message": "You are find something we can't found it here."}

Functions

func ErrHandler

func ErrHandler(err error)

func LoadDatabase

func LoadDatabase(libpath string, d ty.Dbconf) ty.Database

func LoadSo

func LoadSo(path string) *plugin.Plugin

This function will load *.so library without parsing its function. After load library with this function you need to lookup your function.

func ReadRuntime

func ReadRuntime() ty.Runtime

FIXME: affected by issue [#16](https://github.com/septianw/jas/issues/16)

func SendHttpError

func SendHttpError(c *gin.Context, errType uint, err error)

func WriteRuntime

func WriteRuntime(rt ty.Runtime)

FIXME: affected by issue [#16](https://github.com/septianw/jas/issues/16)

Types

type Exception

type Exception interface{}

type TryCatchBlock

type TryCatchBlock struct {
	Try     func()
	Catch   func(Exception)
	Finally func()
}

func (TryCatchBlock) Do

func (tc TryCatchBlock) Do()

Jump to

Keyboard shortcuts

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