Documentation ¶
Index ¶
- Constants
- func CallService(name string, rs *gjson.Result, isRestricted bool, isRoleBased bool, ...) (interface{}, error)
- func CallServiceWithBranch(name, branch string, rs *gjson.Result, isRestricted bool, isRoleBased bool, ...) (interface{}, error)
- func CleanBranch(branch string) string
- func ConcatenateEntityWithBranch(name, branch string) string
- func GRPCInit(GRPCPort net.Listener)
- func GetResponseHeader(serviceName string) (interface{}, bool)
- func HeavyOpenHandler(c *gin.Context)
- func HeavyRestrictedHandler(c *gin.Context)
- func HeavyRoleBasedHandler(c *gin.Context)
- func Init(o, r, c *gin.RouterGroup, JWTKey string)
- func OpenHandler(c *gin.Context)
- func RegisterLoginSerivce(...)
- func RegisterNormalService(serviceName string, servicePtr ServiceType, isRestricted, isRoleBased bool)
- func RegisterServiceInSLS(serviceName string, servicePtr ServiceCache, isRestricted, isRoleBased bool)
- func RestrictedHandler(c *gin.Context)
- func RoleBasedHandler(c *gin.Context)
- func SetAppVersion(appVersion, minSupportedVersion string) error
- type DebugResponse
- type FDBQuery
- type Hook
- type Master
- func (m *Master) FDBService(filPath string, query ...string) *Runable
- func (m *Master) IsCachable() *Master
- func (m *Master) IsCachableWithExpiration(cacheExpirationTime time.Duration) *Master
- func (m *Master) MongoService(collectionName, mongoQuery string) *Runable
- func (m *Master) MongoServiceWithHost(hostName, collectionName, mongoQuery string) *Runable
- type MongoQuery
- type ResponseHeaders
- type Runable
- type Server
- type ServiceCache
- type ServiceType
Constants ¶
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 ¶
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 GetResponseHeader ¶
GetResponseHeader return response header object
func HeavyRestrictedHandler ¶
HeavyRestrictedHandler for /r
func HeavyRoleBasedHandler ¶
HeavyRoleBasedHandler for /r/c
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
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 Master ¶
type Master struct {
// contains filtered or unexported fields
}
Master - struct for master Service
func (*Master) FDBService ¶
FDBService - return mongo query object
func (*Master) IsCachableWithExpiration ¶
IsCachableWithExpiration for both fdb and mongo
func (*Master) MongoService ¶
MongoService - 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 ¶
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 ¶
SetArgs set argument for query string
type Server ¶
type Server struct{}
Server server
func (*Server) GRPCCheck ¶
func (*Server) GRPCCheck(ctx context.Context, req *grpcbuildermdl.GRPCRequest) (*grpcbuildermdl.GRPCResponse, error)
GRPCCheck GRPCCheck
func (*Server) GRPCHandler ¶
func (*Server) GRPCHandler(ctx context.Context, req *grpcbuildermdl.GRPCRequest) (*grpcbuildermdl.GRPCByteResponse, error)
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 ¶
type ServiceType = func(*gjson.Result, servicebuildermdl.Principal) (interface{}, *servicebuildermdl.AbstractBusinessLogicHolder, error)
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