gf_images_service

package
v0.0.0-...-0933345 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: GPL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBmongoIndexInit

func DBmongoIndexInit(pRuntimeSys *gf_core.RuntimeSys) *gf_core.GFerror

func ImageClassify

func ImageClassify(pInput *GFimageClassifyInput,
	pUserID gf_core.GF_ID,
	pJobsMngrCh chan gf_images_jobs_core.JobMsg,
	pServiceInfo *gf_images_core.GFserviceInfo,
	pCtx context.Context,
	pRuntimeSys *gf_core.RuntimeSys) ([]string, *gf_core.GFerror)

func InitHandlers

func InitHandlers(pAuthSubsystemTypeStr string,
	pAuthLoginURLstr string,
	pKeyServer *gf_identity_core.GFkeyServerInfo,
	pHTTPmux *http.ServeMux,
	pTemplatesPathsMap map[string]string,
	pJobsMngrCh chan gf_images_jobs_core.JobMsg,
	pImgConfig *gf_images_core.GFconfig,
	pServiceInfo *gf_images_core.GFserviceInfo,
	pMediaDomainStr string,
	pStorage *gf_images_storage.GFimageStorage,
	pS3info *gf_aws.GFs3Info,
	pMetrics *gf_images_core.GFmetrics,
	pRuntimeSys *gf_core.RuntimeSys) *gf_core.GFerror

func ProcessBrowserImageCalcResult

func ProcessBrowserImageCalcResult(p_browser_jobs_runs_results_lst []map[string]interface{}, pRuntimeSys *gf_core.RuntimeSys) *gf_core.GFerror

func TagsAddToImage

func TagsAddToImage(pImage *gf_images_core.GFimage,
	pTagsLst []string,
	pRuntimeSys *gf_core.RuntimeSys)

func UploadComplete

func UploadComplete(pUploadImageIDstr gf_images_core.GFimageID,
	pFlowsNamesLst []string,
	pMetaMap map[string]interface{},
	pUserID gf_core.GF_ID,
	pJobsMngrCh chan gf_images_jobs_core.JobMsg,
	pServiceInfo *gf_images_core.GFserviceInfo,
	pCtx context.Context,
	pRuntimeSys *gf_core.RuntimeSys) (*gf_images_jobs_core.GFjobRunning, *gf_core.GFerror)

completes the image file upload sequence. It is run after the initialization stage, and after the client/caller conducts the upload operation.

func UploadMetricsCreate

func UploadMetricsCreate(pUploadImageIDstr gf_images_core.GFimageID,
	pClientTypeStr string,
	pMetricsDataMap map[string]interface{},
	pUserID gf_core.GF_ID,
	pMetrics *gf_images_core.GFmetrics,
	pCtx context.Context,
	pRuntimeSys *gf_core.RuntimeSys) *gf_core.GFerror

Types

type Browser__ai_classify__job_run_result

type Browser__ai_classify__job_run_result struct {
	Id                           primitive.ObjectID `bson:"_id,omitempty"`
	T_str                        string             `bson:"t"`
	Img__id_str                  string             `bson:"img__id_str"`
	Browser__unix_start_time_str float64            `bson:"browser__unix_start_time_str"`
	Browser__unix_end_time_str   float64            `bson:"browser__unix_end_time_str"`
	Browser__id_f                float64            `bson:"browser__id_f"`
}

type Browser__job_run_result

type Browser__job_run_result struct {
	Id                           primitive.ObjectID `bson:"_id,omitempty"`
	T_str                        string             `bson:"t"`
	Img__id_str                  string             `bson:"img__id_str"`
	Img__dominant_color_str      string             `bson:"img__dominant_color_str"`
	Img__color_pallete_lst       []string           `bson:"img__color_pallete_lst"`
	Browser__unix_start_time_str float64            `bson:"browser__unix_start_time_str"`
	Browser__unix_end_time_str   float64            `bson:"browser__unix_end_time_str"`
	Browser__id_f                float64            `bson:"browser__id_f"`
}

type GFimageClassifyInput

type GFimageClassifyInput struct {
	ClientTypeStr string
	ImagesIDsLst  []gf_images_core.GFimageID
}

type GFimageUploadInfo

type GFimageUploadInfo struct {
	Id                primitive.ObjectID       `json:"-"                      bson:"_id,omitempty"`
	Tstr              string                   `json:"-"                      bson:"t"` // "img_upload_info"
	CreationUNIXtimeF float64                  `json:"creation_unix_time_f"   bson:"creation_unix_time_f"`
	NameStr           string                   `json:"name_str"               bson:"name_str"`
	ImageIDstr        gf_images_core.GFimageID `json:"upload_gf_image_id_str" bson:"upload_gf_image_id_str"`
	S3filePathStr     string                   `json:"-"                      bson:"s3_file_path_str"` // internal data, dont send to clients
	FlowsNamesLst     []string                 `json:"flows_names_lst"        bson:"flows_names_lst"`
	ClientTypeStr     string                   `json:"-"                      bson:"client_type_str"` // internal data, dont send to clients
	PresignedURLstr   string                   `json:"presigned_url_str"      bson:"presigned_url_str"`
	UserID            gf_core.GF_ID            `json:"user_id_str"            bson:"user_id_str"` // ID of the user starting this upload
}

GFimageUploadInfo struct represents a single image upload sequence. It is both stored in the DB and returned to the initiating client in JSON form. It contains the ID of the future gf_image that will be created in the system to represent the image that the client is wanting to upload.

func UploadInit

func UploadInit(pImageNameStr string,
	pImageFormatStr string,
	pFlowsNamesLst []string,
	pClientTypeStr string,
	pUserID gf_core.GF_ID,
	pStorage *gf_images_storage.GFimageStorage,
	pS3info *gf_aws.GFs3Info,
	pConfig *gf_images_core.GFconfig,
	pServiceInfo *gf_images_core.GFserviceInfo,
	pCtx context.Context,
	pRuntimeSys *gf_core.RuntimeSys) (*GFimageUploadInfo, *gf_core.GFerror)

UploadInit initializes an file upload process. This will create a pre-signed S3 URL for the caller of this function to use for uploading of content to GF.

type GFimageUploadMetrics

type GFimageUploadMetrics struct {
	Id                               primitive.ObjectID       `bson:"_id,omitempty"`
	CreationUNIXtimeF                float64                  `bson:"creation_unix_time_f"`
	ImageIDstr                       gf_images_core.GFimageID `bson:"upload_gf_image_id_str"`
	ClientTypeStr                    string                   `bson:"client_type_str"`
	UploadClientDurationSecF         float64                  `bson:"upload_client_duration_sec_f"`
	UploadClientTransferDurationSecF float64                  `bson:"upload_client_transfer_duration_sec_f"`
	UserID                           gf_core.GF_ID            `bson:"user_id_str"` // ID of the user starting this upload
}

Jump to

Keyboard shortcuts

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