routebuildermdl

package
v2.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Header_Branch = "Service-Branch"
)

Variables

This section is empty.

Functions

func CallService

func CallService(name string, rs *gjson.Result, isRestricted bool, isRoleBased bool, p servicebuildermdl.Principal) (interface{}, error)

CallService - calls service with provided configuration, returns result and error from executed service

func CallServiceWithBranch

func CallServiceWithBranch(name, branch string, rs *gjson.Result, isRestricted bool, isRoleBased bool, p servicebuildermdl.Principal) (interface{}, error)

CallServiceWithBranch - calls service of given branch with provided configuration, returns result and error from executed service

func CleanBranch

func CleanBranch(branch string) string

CleanBranch returns "main" branch if the branch string is empty after trimming all spaces. if Non-empty returns same string(including spaces along with characters).

func ConcatenateEntityWithBranch

func ConcatenateEntityWithBranch(name, branch string) string

func GRPCInit

func GRPCInit(GRPCPort net.Listener)

GRPCInit init

func GetResponseHeader

func GetResponseHeader(serviceName string) (interface{}, bool)

GetResponseHeader return response header object

func HeavyOpenHandler

func HeavyOpenHandler(c *gin.Context)

HeavyOpenHandler for /o

func HeavyRestrictedHandler

func HeavyRestrictedHandler(c *gin.Context)

HeavyRestrictedHandler for /r

func HeavyRoleBasedHandler

func HeavyRoleBasedHandler(c *gin.Context)

HeavyRoleBasedHandler for /r/c

func Init

func Init(o, r, c *gin.RouterGroup, JWTKey string)

Init routing init

func OpenHandler

func OpenHandler(c *gin.Context)

OpenHandler for /o

func RegisterLoginSerivce

func RegisterLoginSerivce(service func(*gjson.Result, servicebuildermdl.Principal) (interface{}, string, error))

RegisterLoginSerivce is for login service

func RegisterNormalService

func RegisterNormalService(serviceName string, servicePtr ServiceType, isRestricted, isRoleBased bool)

RegisterNormalService is for transactional services

func RegisterServiceInSLS

func RegisterServiceInSLS(serviceName string, servicePtr ServiceCache, isRestricted, isRoleBased bool)

RegisterServiceInSLS is for transactional services

func RestrictedHandler

func RestrictedHandler(c *gin.Context)

RestrictedHandler for /r

func RoleBasedHandler

func RoleBasedHandler(c *gin.Context)

RoleBasedHandler for /r/c

func SetAppVersion

func SetAppVersion(appVersion, minSupportedVersion string) error

SetAppVersion -SetAppVersion

Types

type DebugResponse

type DebugResponse struct {
	StackTrace      interface{} `json:"stackTrace"`
	PerformanceInfo interface{} `json:"performanceInfo"`
}

DebugResponse - DebugResponse

type FDBQuery

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

FDBQuery - for fdb services

type Hook

type Hook struct {
	ActivityName string
	ActorType    string
	Branch       string
}

Hook - Hook

type Master

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

Master - struct for master Service

func (*Master) FDBService

func (m *Master) FDBService(filPath string, query ...string) *Runable

FDBService - return mongo query object

func (*Master) IsCachable

func (m *Master) IsCachable() *Master

IsCachable for both fdb and mongo

func (*Master) IsCachableWithExpiration

func (m *Master) IsCachableWithExpiration(cacheExpirationTime time.Duration) *Master

IsCachableWithExpiration for both fdb and mongo

func (*Master) MongoService

func (m *Master) MongoService(collectionName, mongoQuery string) *Runable

MongoService - return mongo query object

func (*Master) MongoServiceWithHost

func (m *Master) MongoServiceWithHost(hostName, collectionName, mongoQuery string) *Runable

MongoServiceWithHost - return mongo query object

type MongoQuery

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

MongoQuery - for mongo service

type ResponseHeaders

type ResponseHeaders struct {
	ServiceName string
	HeaderID    string           `json:"headerId"`
	LCache      bool             `json:"lCache"`
	Methods     []responseMethod `json:"methods"`
}

ResponseHeaders this is struct for Response headers

func CreateResponseHeader

func CreateResponseHeader(serviceName string) *ResponseHeaders

CreateResponseHeader create an instance of response header for service

func (*ResponseHeaders) AddMethod

func (rh *ResponseHeaders) AddMethod(name string, data interface{}) *ResponseHeaders

AddMethod add method and data in response

func (*ResponseHeaders) DisableReponseCache

func (rh *ResponseHeaders) DisableReponseCache() *ResponseHeaders

DisableReponseCache cache this response in local storge

func (*ResponseHeaders) EnableReponseCache

func (rh *ResponseHeaders) EnableReponseCache() *ResponseHeaders

EnableReponseCache cache this response in local storge

func (*ResponseHeaders) SetResponseHeader

func (rh *ResponseHeaders) SetResponseHeader()

SetResponseHeader set response headers in cache

type Runable

type Runable struct {
	Master
	MongoQuery
	FDBQuery
}

Runable - helps to run

func (*Runable) IsAggregationQuery

func (m *Runable) IsAggregationQuery() *Runable

IsAggregationQuery - Set flag for aggregation query

func (*Runable) Run

func (m *Runable) Run(data []byte, principal *servicebuildermdl.Principal) (interface{}, error)

Run - execute and return output and error

func (*Runable) SetArgs

func (m *Runable) SetArgs(args ...string) *Runable

SetArgs set argument for query string

func (*Runable) SetProjectionQuery

func (m *Runable) SetProjectionQuery(query string) *Runable

SetProjectionQuery set SetProjectionQuery for query string

type Server

type Server struct{}

Server server

func (*Server) GRPCCheck

GRPCCheck GRPCCheck

func (*Server) GRPCHandler

GRPCHandler GRPCHandler

type ServiceCache

type ServiceCache struct {
	Service            func(*gjson.Result, servicebuildermdl.Principal) (interface{}, *servicebuildermdl.AbstractBusinessLogicHolder, error)
	AsyncService       bool
	HeavyDataActivity  bool
	PreHooks           []Hook
	PostHooks          []Hook
	Groups             []string
	TransactionEnabled bool
	DatabaseType       string // database type for transaction begin(MYSQL,SQLSERVER etc.)
	TransactionHost    string // host to begin transaction. if it is empty then transaction will begin on default host
}

ServiceCache ServiceCache object

type ServiceType

ServiceType -ServiceType

func GetOpenServicePtr

func GetOpenServicePtr(serviceName string) (ServiceType, error)

GetOpenServicePtr -GetOpenServicePtr

func GetRestrictedServicePtr

func GetRestrictedServicePtr(serviceName string) (ServiceType, error)

GetRestrictedServicePtr -GetRestrictedServicePtr

func GetRoleBasedServicePtr

func GetRoleBasedServicePtr(serviceName string) (ServiceType, error)

GetRoleBasedServicePtr -GetRoleBasedServicePtr

Jump to

Keyboard shortcuts

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