microgate

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRestClient

func GetRestClient() *resty.Client

func Print

func Print(restCallKey int, status, header, resp bool) func(ctx floc.Context, ctrl floc.Control) error

func ProcessHandler

func ProcessHandler(jobs floc.Job) func(ctx *gin.Context)

func RestCall

func RestCall(restCallKey int, r *RestRequestData) func(ctx floc.Context, ctrl floc.Control) error

Types

type DataObject

type DataObject map[string]interface{}

func MarshalToDataObject

func MarshalToDataObject(b []byte) *DataObject

func NewDataObject

func NewDataObject() DataObject

func (DataObject) Get

func (this DataObject) Get(key string) interface{}

func (DataObject) GetArray

func (this DataObject) GetArray(key string) (newArray *List, err error)

func (*DataObject) GetBool

func (data *DataObject) GetBool(key string) bool

func (*DataObject) GetFloat64

func (data *DataObject) GetFloat64(key string) float64

func (*DataObject) GetInt

func (data *DataObject) GetInt(key string) int

func (DataObject) GetObject

func (this DataObject) GetObject(key string) (value DataObject, err error)

func (*DataObject) GetObjectByPath

func (data *DataObject) GetObjectByPath(path string) *DataObject

func (*DataObject) GetString

func (data *DataObject) GetString(key string) string

func (DataObject) Indent

func (this DataObject) Indent() string

func (DataObject) Put

func (this DataObject) Put(key string, value interface{}) DataObject

func (*DataObject) PutObjectByPath

func (data *DataObject) PutObjectByPath(path string) *DataObject

func (DataObject) Remove

func (this DataObject) Remove(key string) DataObject

func (DataObject) String

func (this DataObject) String() string

type LimeCache

type LimeCache struct {
	Cache  *ttlcache.Cache
	Logger *zap.Logger
}

func Cache

func Cache(totalStorageTime time.Duration) *LimeCache

func (*LimeCache) AttachLogger

func (cache *LimeCache) AttachLogger(logger *zap.Logger)

func (*LimeCache) Get

func (cache *LimeCache) Get(key string) (interface{}, bool)

func (*LimeCache) Set

func (cache *LimeCache) Set(key string, value interface{}, time time.Duration)

type LimeObject

type LimeObject map[string]interface{}

type LimeServer

type LimeServer struct {
	Server   *http.Server
	Router   *gin.Engine
	Security struct {
		AllowedHosts []string
		STSSeconds   int64
		AllowOrigins []string
	}
}

func Server

func Server(port string, readTimeout time.Duration, writeTimeout time.Duration) *LimeServer

func (*LimeServer) ANY

func (lime *LimeServer) ANY(sec PathSecurity, relativePath string, handlers ...gin.HandlerFunc)

func (*LimeServer) AddCookie

func (lime *LimeServer) AddCookie(secret string)

func (*LimeServer) DELETE

func (lime *LimeServer) DELETE(sec PathSecurity, relativePath string, handlers ...gin.HandlerFunc)

func (*LimeServer) GET

func (lime *LimeServer) GET(sec PathSecurity, relativePath string, handlers ...gin.HandlerFunc)

func (*LimeServer) HEAD

func (lime *LimeServer) HEAD(sec PathSecurity, relativePath string, handlers ...gin.HandlerFunc)

func (*LimeServer) InitSecurity

func (lime *LimeServer) InitSecurity(allowedHosts []string, sTSSeconds int64, allowOrigins []string)

func (*LimeServer) LoadStaticFiles

func (lime *LimeServer) LoadStaticFiles(path string)

func (*LimeServer) PATCH

func (lime *LimeServer) PATCH(sec PathSecurity, relativePath string, handlers ...gin.HandlerFunc)

func (*LimeServer) POST

func (lime *LimeServer) POST(sec PathSecurity, relativePath string, handlers ...gin.HandlerFunc)

func (*LimeServer) PUT

func (lime *LimeServer) PUT(sec PathSecurity, relativePath string, handlers ...gin.HandlerFunc)

func (*LimeServer) SetSecurity

func (lime *LimeServer) SetSecurity(waf, usecors, proxy, recovery bool)

func (*LimeServer) Start

func (lime *LimeServer) Start()

type List

type List []interface{}

func Array

func Array() *List

func (*List) Indent

func (list *List) Indent() string

func (*List) OfString

func (list *List) OfString() (values []string, err error)

func (*List) Put

func (list *List) Put(value interface{}) *List

func (*List) Size

func (list *List) Size() int

func (*List) String

func (list *List) String() string

type Mapping

type Mapping struct {
	FromElement  MappingElement
	ToElement    MappingElement
	OptConverter func(from MappingElement) MappingElement
}

type MappingElement

type MappingElement struct {
	PathToObject string
	Key          string
	Type         string
}

type MappingTable

type MappingTable struct {
	Mappings []Mapping
}

func (MappingTable) DoMapping

func (m MappingTable) DoMapping(restCallKey int) func(ctx floc.Context, ctrl floc.Control) error

type PathSecurity

type PathSecurity struct {
	UseCache    bool
	CachePublic bool
	MaxAge      string
	Expires     time.Time
}

type RestRequestData

type RestRequestData struct {
	QueryParams map[string]string
	Header      map[string]string
	Token       string
	BaseUrl     string
	Path        string
	Method      string
}

Jump to

Keyboard shortcuts

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