Documentation ¶
Index ¶
- Variables
- func AttachMapToSentryScope(pMap map[string]interface{}, pScope *sentry.Scope)
- func BreadcrumbsAdd(pCategoryStr string, pMsgStr string, pDataMap map[string]interface{}, ...)
- func CastToStr(pElement interface{}) (bool, string)
- func ConfigGetArg(pArgNameStr string, pCmd *cobra.Command) string
- func CryptoConvertKeysToPEM(pPrivateKey *rsa.PrivateKey, pPublicKey *rsa.PublicKey) (string, string)
- func CryptoConvertPubKeyToPEM(pPublicKey *rsa.PublicKey) string
- func CryptoGenerateKeys() (*rsa.PublicKey, *rsa.PrivateKey)
- func CryptoGenerateKeysAsPEM() (string, string)
- func DBsqlGetNullStringOrDefault(pNullableStr sql.NullString, pDefaultValStr string) string
- func EncodeJSONfromData(pInput interface{}) []byte
- func ErrorInitSentry(pSentryEndpointStr string, pTransactionsTracingRateMap map[string]float64, ...) error
- func GetTokenShorthand(pTokenStr string) string
- func HTTPdeleteCookieOnResp(pCookieNameStr string, pResp http.ResponseWriter)
- func HTTPdisableCachingOfResponse(pResp http.ResponseWriter)
- func HTTPfetchURL(pURLstr string, pHeadersMap map[string]string, pUserAgentStr string, ...) (*GF_http_fetch, *GFerror)
- func HTTPgetAllCookies(pReq *http.Request) map[string]interface{}
- func HTTPgetCookieFromReq(pCookieNameStr string, pReq *http.Request, pRuntimeSys *RuntimeSys) (bool, string)
- func HTTPgetReqConfig() (map[string]string, string)
- func HTTPinitStaticServing(pURLbaseStr string, pRuntimeSys *RuntimeSys)
- func HTTPinitStaticServingWithMux(pURLbaseStr string, p_local_dir_path_str string, p_mux *http.ServeMux, ...)
- func HTTPserializeCookies(pCookiesLst []*http.Cookie, pRuntimeSys *RuntimeSys) string
- func HTTPserveFile(pLocalDirStr string, pURLstr string, pReq *http.Request, ...)
- func HTTPsetCookieOnReq(pCookieNameStr string, pDataStr string, pDomainStr *string, pReq *http.Request, ...)
- func HTTPsetCookieOnResp(pCookieNameStr string, pDataStr string, pDomainStr *string, ...)
- func HashValSha256(pVal interface{}) string
- func ListContainsStr(pStr string, pLst []string) bool
- func ListPop[T any](pLst []T) (T, []T)
- func ListRemoveElementAtIndex(pLst []interface{}, pIndex int) []interface{}
- func LogsIsDebugEnabled() bool
- func MapHasKey[K string, V any](pMap map[K]V, pKeyStr string) bool
- func MongoStart(p_mongodb_bin_path_str string, p_mongodb_port_str int, ...) error
- func PanicCheckAndHandle(pUserMsgStr string, pPanicDataMap map[string]interface{}, ...)
- func StrRandom() string
- func StringInList(pTargetStr string, pLst []string) bool
- func ValidateInit() *validator.Validate
- type ErrorDef
- type ExternalPlugins
- type GF_ID
- type GF_http_fetch
- type GFcliCmdInfo
- type GFerror
- func CLIprompt(pMsgStr string, pRuntimeSys *RuntimeSys) (bool, *GFerror)
- func CLIpyRun(pPyPathStr string, pArgsLst []string, pInputStdinStr *string, ...) ([]map[string]interface{}, *GFerror)
- func CLIrun(pCmdInfo *GFcliCmdInfo, pRuntimeSys *RuntimeSys) ([]string, []string, *GFerror)
- func CLIrunCore(pCmdInfo *GFcliCmdInfo, pWaitForCompletionBool bool, pRuntimeSys *RuntimeSys) (chan string, chan string, *GFerror)
- func CLIrunStandard(pCmdLst []string, pEnvVarsMap map[string]string, pRuntimeSys *RuntimeSys) ([]string, []string, *GFerror)
- func CryptoParseKeysFromPEM(pPublicKeyPEMstr string, pPrivateKeyPEMstr string, pRuntimeSys *RuntimeSys) (*rsa.PublicKey, *rsa.PrivateKey, *GFerror)
- func DBsqlConnect(pDBnameStr string, pUserNameStr string, pPassStr string, pDBhostStr string, ...) (*sql.DB, *GFerror)
- func DBsqlViewTableStructure(pTableNameStr string, pRuntimeSys *RuntimeSys) *GFerror
- func ErrorCreate(pUserMsgStr string, pErrorTypeStr string, pErrorDataMap map[string]interface{}, ...) *GFerror
- func ErrorCreateWithDefs(pUserMsgStr string, pErrorTypeStr string, pErrorDataMap map[string]interface{}, ...) *GFerror
- func ErrorCreateWithHook(pUserMsgStr string, pErrorTypeStr string, pErrorDataMap map[string]interface{}, ...) *GFerror
- func ErrorCreateWithStackSkip(pUserMsgStr string, pErrorTypeStr string, pErrorDataMap map[string]interface{}, ...) *GFerror
- func FileCopy(pSourceFileLocalPathStr string, pTargetFileLocalPathStr string, ...) *GFerror
- func FileCreateWithContent(pContentStr string, pFilePathStr string, pRuntimeSys *RuntimeSys) *GFerror
- func FileRead(pLocalFilePathStr string, pRuntimeSys *RuntimeSys) (string, *GFerror)
- func FileReadBytes(pLocalFilePathStr string, pRuntimeSys *RuntimeSys) ([]byte, *GFerror)
- func HTTPdetectMIMEtypeFromURL(pURLstr string, pHeadersMap map[string]string, pUserAgentStr string, ...) (string, *GFerror)
- func HTTPgetFile(pTargetURLstr string, pFileLocalPathStr string, pCtx context.Context, ...) *GFerror
- func HTTPgetInput(pReq *http.Request, pRuntimeSys *RuntimeSys) (map[string]interface{}, *GFerror)
- func HTTPgetStreamingResponse(pURLstr string, pRuntimeSys *RuntimeSys) (*[]map[string]interface{}, *GFerror)
- func HTTPinitSSE(pResp http.ResponseWriter, pRuntimeSys *RuntimeSys) (http.Flusher, *GFerror)
- func HTTPputFile(pTargetURLstr string, pFilePathStr string, pHeadersMap map[string]string, ...) (*http.Response, *GFerror)
- func MongoCollExists(pCollNameStr string, pCtx context.Context, pRuntimeSys *RuntimeSys) (bool, *GFerror)
- func MongoConnectNew(pMongoServerURLstr string, pDBnameStr string, pTLScustomConfig *tls.Config, ...) (*mongo.Database, *mongo.Client, *GFerror)
- func MongoCount(pQuery bson.M, pMetaMap map[string]interface{}, pColl *mongo.Collection, ...) (int64, *GFerror)
- func MongoDelete(pQuery bson.M, pCollNameStr string, pMetaMap map[string]interface{}, ...) *GFerror
- func MongoEnsureIndex(pIndexesKeysLst [][]string, pIndexesNamesLst []string, pCollNameStr string, ...) *GFerror
- func MongoFind(pQuery bson.M, pOpts *options.FindOptions, pMetaMap map[string]interface{}, ...) (*mongo.Cursor, *GFerror)
- func MongoFindLatest(pQuery bson.M, pTimeFieldNameStr string, pMetaMap map[string]interface{}, ...) (map[string]interface{}, *GFerror)
- func MongoHandleError(p_user_msg_str string, p_error_type_str string, ...) *GFerror
- func MongoInsert(p_record interface{}, pCollNameStr string, pMetaMap map[string]interface{}, ...) *GFerror
- func MongoTXinit(pMongoClient *mongo.Client, pMetaMap map[string]interface{}, ...) (mongo.Session, *options.TransactionOptions, *GFerror)
- func MongoTXrun(pTXfun func() *GFerror, pMetaMap map[string]interface{}, ...) (mongo.Session, *GFerror)
- func MongoUpsert(pQuery bson.M, pRecord interface{}, pMetaMap map[string]interface{}, ...) *GFerror
- func MongoUpsertBulk(pFilterDocsByFieldsLst []map[string]string, pRecordsLst []interface{}, ...) (int64, *GFerror)
- func ParseJSONfromByteList(pBytesLst []byte, pRuntimeSys *RuntimeSys) (map[string]interface{}, *GFerror)
- func ParseJSONfromString(pJSONstr string, pRuntimeSys *RuntimeSys) (interface{}, *GFerror)
- func TemplatesLoad(pMainTemplateFilepathStr string, pRuntimeSys *RuntimeSys) (*template.Template, []string, *GFerror)
- func ValidateStruct(pTarget interface{}, pRuntimeSys *RuntimeSys) *GFerror
- type GFlogFun
- type GFmetrics
- type Gf_http_fetch
- type HTTPfetch
- type HTTPhandler
- type HTTPhandlerInfo
- type RuntimeSys
- type SysReleaseInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var GitCommitSHAshortStr = "GF_COMMIT_SHORT_SHA"
View Source
var GitCommitSHAstr = "GF_COMMIT_SHA"
Functions ¶
func AttachMapToSentryScope ¶
func AttachMapToSentryScope(pMap map[string]interface{}, pScope *sentry.Scope)
func BreadcrumbsAdd ¶
func CryptoConvertKeysToPEM ¶
func CryptoGenerateKeys ¶
func CryptoGenerateKeys() (*rsa.PublicKey, *rsa.PrivateKey)
generate RSA private/public keys (4096 bit)
func CryptoGenerateKeysAsPEM ¶
generate new RSA private/public key-pair (4096 bit) and encoded it into the PEM format and return as two separate strings.
func DBsqlGetNullStringOrDefault ¶
func DBsqlGetNullStringOrDefault(pNullableStr sql.NullString, pDefaultValStr string) string
func EncodeJSONfromData ¶
func EncodeJSONfromData(pInput interface{}) []byte
func ErrorInitSentry ¶
func GetTokenShorthand ¶
func HTTPdeleteCookieOnResp ¶
func HTTPdeleteCookieOnResp(pCookieNameStr string, pResp http.ResponseWriter)
func HTTPdisableCachingOfResponse ¶
func HTTPdisableCachingOfResponse(pResp http.ResponseWriter)
func HTTPfetchURL ¶
func HTTPfetchURL(pURLstr string, pHeadersMap map[string]string, pUserAgentStr string, pCtx context.Context, pRuntimeSys *RuntimeSys) (*GF_http_fetch, *GFerror)
func HTTPgetAllCookies ¶
func HTTPgetCookieFromReq ¶
func HTTPgetReqConfig ¶
func HTTPinitStaticServing ¶
func HTTPinitStaticServing(pURLbaseStr string, pRuntimeSys *RuntimeSys)
func HTTPinitStaticServingWithMux ¶
func HTTPinitStaticServingWithMux(pURLbaseStr string, p_local_dir_path_str string, p_mux *http.ServeMux, pRuntimeSys *RuntimeSys)
func HTTPserializeCookies ¶
func HTTPserializeCookies(pCookiesLst []*http.Cookie, pRuntimeSys *RuntimeSys) string
func HTTPserveFile ¶
func HTTPserveFile(pLocalDirStr string, pURLstr string, pReq *http.Request, pResp http.ResponseWriter, pRuntimeSys *RuntimeSys)
func HTTPsetCookieOnReq ¶
func HTTPsetCookieOnResp ¶
func HashValSha256 ¶
func HashValSha256(pVal interface{}) string
func ListContainsStr ¶
func ListRemoveElementAtIndex ¶
func ListRemoveElementAtIndex(pLst []interface{}, pIndex int) []interface{}
func LogsIsDebugEnabled ¶
func LogsIsDebugEnabled() bool
func MongoStart ¶
func PanicCheckAndHandle ¶
func PanicCheckAndHandle(pUserMsgStr string, pPanicDataMap map[string]interface{}, pOnCompleteFun func(), pSubsystemNameStr string, pRuntimeSys *RuntimeSys)
func StringInList ¶
func ValidateInit ¶
Types ¶
type ExternalPlugins ¶
type ExternalPlugins struct { //--------------------------- // RPC_HANDLERS RPChandlersGetCallback func(*RuntimeSys) ([]HTTPhandlerInfo, *GFerror) // CORS_DOMAINS - domains that are allowed to access the API, beyond the domain // that the API is hosted on. CORSoriginDomainsLst []string //--------------------------- // IMAGES ImageFilterMetadataCallback func(map[string]interface{}) map[string]interface{} //--------------------------- // EVENTS EventCallback func(string, map[string]interface{}, GF_ID, *RuntimeSys) *GFerror //--------------------------- // SECRETS SecretCreateCallback func(string, map[string]interface{}, string, *RuntimeSys) *GFerror SecretGetCallback func(string, *RuntimeSys) (map[string]interface{}, *GFerror) // called on every sending of email in the system EmailSendingCallback func(string, string, string, string, *RuntimeSys) *GFerror //--------------------------- // NFT // get metadata on defined fetchers NFTgetFetchersMetaCallback func() map[string]map[string]interface{} // fetch NFTs for a particular owner account using a particular fetcher (with name) NFTfetchForOwnerAddressCallback func(string, string, *RuntimeSys) *GFerror }
type GF_http_fetch ¶
type GF_http_fetch = Gf_http_fetch
type GFcliCmdInfo ¶
type GFerror ¶
type GFerror struct { Id bson.ObjectId `bson:"_id,omitempty"` Id_str string `bson:"id_str"` T_str string `bson:"t"` // "gf_error" Creation_unix_time_f float64 `bson:"creation_unix_time_f"` Type_str string `bson:"type_str"` User_msg_str string `bson:"user_msg_str"` Data_map map[string]interface{} `bson:"data_map"` Descr_str string `bson:"descr_str"` Error error `bson:"error"` ServiceNameStr string `bson:"service_name_str"` Subsystem_name_str string `bson:"subsystem_name_str"` // major portion of functionality, a particular package, or a logical group of functions Stack_trace_str string `bson:"stack_trace_str"` Function_name_str string `bson:"func_name_str"` File_str string `bson:"file_str"` Line_num_int int `bson:"line_num_int"` }
func CLIprompt ¶
func CLIprompt(pMsgStr string, pRuntimeSys *RuntimeSys) (bool, *GFerror)
prompt the user for a confirmation to proceed or not
func CLIrun ¶
func CLIrun(pCmdInfo *GFcliCmdInfo, pRuntimeSys *RuntimeSys) ([]string, []string, *GFerror)
func CLIrunCore ¶
func CLIrunCore(pCmdInfo *GFcliCmdInfo, pWaitForCompletionBool bool, pRuntimeSys *RuntimeSys) (chan string, chan string, *GFerror)
func CLIrunStandard ¶
func CryptoParseKeysFromPEM ¶
func CryptoParseKeysFromPEM(pPublicKeyPEMstr string, pPrivateKeyPEMstr string, pRuntimeSys *RuntimeSys) (*rsa.PublicKey, *rsa.PrivateKey, *GFerror)
parse a private key from a PEM string
func DBsqlConnect ¶
func DBsqlViewTableStructure ¶
func DBsqlViewTableStructure(pTableNameStr string, pRuntimeSys *RuntimeSys) *GFerror
func ErrorCreate ¶
func ErrorCreateWithDefs ¶
func ErrorCreateWithHook ¶
func FileCopy ¶
func FileCopy(pSourceFileLocalPathStr string, pTargetFileLocalPathStr string, pRuntimeSys *RuntimeSys) *GFerror
func FileCreateWithContent ¶
func FileCreateWithContent(pContentStr string, pFilePathStr string, pRuntimeSys *RuntimeSys) *GFerror
func FileReadBytes ¶
func FileReadBytes(pLocalFilePathStr string, pRuntimeSys *RuntimeSys) ([]byte, *GFerror)
func HTTPgetFile ¶
func HTTPgetInput ¶
func HTTPgetInput(pReq *http.Request, pRuntimeSys *RuntimeSys) (map[string]interface{}, *GFerror)
func HTTPgetStreamingResponse ¶
func HTTPgetStreamingResponse(pURLstr string, pRuntimeSys *RuntimeSys) (*[]map[string]interface{}, *GFerror)
func HTTPinitSSE ¶
func HTTPinitSSE(pResp http.ResponseWriter, pRuntimeSys *RuntimeSys) (http.Flusher, *GFerror)
func HTTPputFile ¶
func MongoCollExists ¶
func MongoConnectNew ¶
func MongoCount ¶
func MongoCount(pQuery bson.M, pMetaMap map[string]interface{}, pColl *mongo.Collection, pCtx context.Context, pRuntimeSys *RuntimeSys) (int64, *GFerror)
func MongoDelete ¶
func MongoEnsureIndex ¶
func MongoEnsureIndex(pIndexesKeysLst [][]string, pIndexesNamesLst []string, pCollNameStr string, pRuntimeSys *RuntimeSys) *GFerror
func MongoFind ¶
func MongoFind(pQuery bson.M, pOpts *options.FindOptions, pMetaMap map[string]interface{}, pColl *mongo.Collection, pCtx context.Context, pRuntimeSys *RuntimeSys) (*mongo.Cursor, *GFerror)
func MongoFindLatest ¶
func MongoHandleError ¶
func MongoInsert ¶
func MongoTXinit ¶
func MongoTXinit(pMongoClient *mongo.Client, pMetaMap map[string]interface{}, pRuntimeSys *RuntimeSys) (mongo.Session, *options.TransactionOptions, *GFerror)
func MongoTXrun ¶
func MongoUpsert ¶
func MongoUpsert(pQuery bson.M, pRecord interface{}, pMetaMap map[string]interface{}, pColl *mongo.Collection, pCtx context.Context, pRuntimeSys *RuntimeSys) *GFerror
func MongoUpsertBulk ¶
func ParseJSONfromByteList ¶
func ParseJSONfromByteList(pBytesLst []byte, pRuntimeSys *RuntimeSys) (map[string]interface{}, *GFerror)
func ParseJSONfromString ¶
func ParseJSONfromString(pJSONstr string, pRuntimeSys *RuntimeSys) (interface{}, *GFerror)
func TemplatesLoad ¶
func ValidateStruct ¶
func ValidateStruct(pTarget interface{}, pRuntimeSys *RuntimeSys) *GFerror
type GFmetrics ¶
type GFmetrics struct { // ERRORS_COUNTER - number of GF errors that were thrown ErrorsCounter prometheus.Counter }
func MetricsInit ¶
type Gf_http_fetch ¶
type HTTPhandler ¶
type HTTPhandlerInfo ¶
type HTTPhandlerInfo struct { AuthBool bool PathStr string HandlerFun HTTPhandler }
type RuntimeSys ¶
type RuntimeSys struct { ServiceNameStr string EnvStr string Debug_bool bool // if debug mode is enabled (some places will print extra info in debug mode) LogFun func(string, string) LogNewFun GFlogFun // DB SQLdb *sql.DB Mongo_db *mongo.Database Mongo_coll *mongo.Collection // main mongodb collection to use when none is specified // ERRORS Errors_send_to_mongodb_bool bool // if errors should be persisted to Mongodb ErrorsSendToSentryBool bool // if errors should be sent to Sentry service NamesPrefixStr string Validator *validator.Validate // PLUGINS ExternalPlugins *ExternalPlugins Metrics *GFmetrics // HTTP_PROXY // if a http proxy should be use this value is set // "http://proxy:8888" HTTPproxyServerURIstr string // SENTRY - used to pass the DNS to py sentry clients. SentryDSNstr string // EVENTS EnableEventsAppBool bool }
type SysReleaseInfo ¶
type SysReleaseInfo struct { Name_str string Version_str string Description_str string Git_commit_str string GitCommitShortStr string }
func GetSysReleseInfo ¶
func GetSysReleseInfo(pRuntimeSys *RuntimeSys) SysReleaseInfo
Source Files ¶
Click to show internal directories.
Click to hide internal directories.