Documentation ¶
Index ¶
- Constants
- func CLIparseArgs(pLogFun func(string, string)) map[string]interface{}
- func CheckImageFormat(pFormatStr string, pRuntimeSys *gf_core.RuntimeSys) bool
- func ConfigGetS3bucketForFlow(pFlowNameStr string, pConfig *GFconfig) string
- func DBmongoImageExists(pImageIDstr GFimageID, pCtx context.Context, pRuntimeSys *gf_core.RuntimeSys) (bool, *gf_core.GFerror)
- func DBmongoPutImage(pImage *GFimage, pCtx context.Context, pRuntimeSys *gf_core.RuntimeSys) *gf_core.GFerror
- func DownloadFile(pImageURLstr string, p_local_image_file_path_str string, ...) *gf_core.GFerror
- func GetImageDimensionsFromFile(pFile io.Reader, pImageExtStr string, pRuntimeSys *gf_core.RuntimeSys) (int, int, *gf_core.GFerror)
- func GetImageDimensionsFromFilepath(pImageLocalFilePathStr string, pRuntimeSys *gf_core.RuntimeSys) (int, int, *gf_core.GFerror)
- func GetImageDimensionsFromImage(pImg image.Image, pRuntimeSys *gf_core.RuntimeSys) (int, int)
- func GetImageExtFromURL(pImageURLstr string, pRuntimeSys *gf_core.RuntimeSys) (string, *gf_core.GFerror)
- func GetImageLargerDimension(pImage image.Image, pRuntimeSys *gf_core.RuntimeSys) (int, string)
- func GetImageOriginalFilenameFromURL(pImageURLstr string, pRuntimeSys *gf_core.RuntimeSys) (string, *gf_core.GFerror)
- func GetImageTitleFromURL(pImageURLstr string, pRuntimeSys *gf_core.RuntimeSys) (string, *gf_core.GFerror)
- func ImageGetFilepathFromID(pImageIDstr GFimageID, pImageFormatStr string) string
- func ImageGetPublicURL(pImageFilePathStr string, pMediaDomainStr string, ...) string
- func ImageLoadFile(pImageLocalFilePathStr string, pNormalizedExtStr string, ...) (image.Image, *gf_core.GFerror)
- func NormalizeImageFormat(pFormatStr string) string
- func RunClassify(pImagesIDsLst []GFimageID, pPyDirPathStr string, pMetrics *GFmetrics, ...) ([]string, *gf_core.GFerror)
- func RunPyClassify(pImagesIDsLst []GFimageID, pPyDirPathStr string, pMetrics *GFmetrics, ...) ([]string, *gf_core.GFerror)
- func S3getImage(pImageS3filePathStr string, pTargetFileLocalPathStr string, ...) *gf_core.GFerror
- func S3getImageFilepath(pImageIDstr GFimageID, pImageFormatStr string, pRuntimeSys *gf_core.RuntimeSys) string
- func S3getImageOriginalFileS3filepath(p_image *GFimage, pRuntimeSys *gf_core.RuntimeSys) string
- func S3getImageThumbsS3filepaths(p_image *GFimage, pRuntimeSys *gf_core.RuntimeSys) (string, string, string)
- func S3storeImage(pImageLocalFilePathStr string, pImageThumbs *GFimageThumbs, ...) *gf_core.GFerror
- func S3storeThumbnails(pImageThumbs *GFimageThumbs, pS3bucketNameStr string, pS3info *gf_aws.GFs3Info, ...) *gf_core.GFerror
- func SharePipeline(pInput *GFshareInput, pUserID gf_core.GF_ID, pServiceInfo *GFserviceInfo, ...) *gf_core.GFerror
- func StoreThumbnails(pImageThumbs *GFimageThumbs, pStorage *gf_images_storage.GFimageStorage, ...) *gf_core.GFerror
- func ThumbsGetSizeInPx(pThumbSizeInPxInt int, pOriginalLargerDimensionInPxInt int, ...) (int, int)
- func TransformImage(pImageIDstr GFimageID, pImageClientTypeStr string, ...) (*GFimage, *GFimageThumbs, *gf_core.GFerror)
- func TransformProcessImage(pImageIDstr GFimageID, pImageClientTypeStr string, ...) (*GFimage, *GFimageThumbs, *gf_core.GFerror)
- func TransformProcessImageV2(pImageLocalFilePathStr string, pUserID gf_core.GF_ID, pCtx context.Context, ...) *gf_core.GFerror
- func VerifyImageInfo(pImageInfoMap map[string]interface{}, pRuntimeSys *gf_core.RuntimeSys) (map[string]interface{}, *gf_core.GFerror)
- type GF_image_id
- type GFconfig
- type GFimage
- func CreateTestImages(pUserID gf_core.GF_ID, pTest *testing.T, pCtx context.Context, ...) *GFimage
- func DBmongoGetImage(pImageIDstr GFimageID, pCtx context.Context, pRuntimeSys *gf_core.RuntimeSys) (*GFimage, *gf_core.GFerror)
- func DBmongoGetRandomImagesRange(pImgsNumToGetInt int, pMaxRandomCursorPositionInt int, pFlowNameStr string, ...) ([]*GFimage, *gf_core.GFerror)
- func ImageCreateNew(pImageInfo *GFimageNewInfo, pCtx context.Context, ...) (*GFimage, *gf_core.GFerror)
- type GFimageExport
- type GFimageID
- func CreateIDfromURL(pImageURLstr string, pRuntimeSys *gf_core.RuntimeSys) (GFimageID, *gf_core.GFerror)
- func CreateImageFilePathFromURL(pImageIDstr GFimageID, pImageURLstr string, pImagesStoreLocalDirPathStr string, ...) (string, GFimageID, *gf_core.GFerror)
- func CreateImageID(pImageURIstr string, pRuntimeSys *gf_core.RuntimeSys) GFimageID
- func FetcherGetExternImage(pImageURLstr string, pImagesStoreLocalDirPathStr string, ...) (string, GFimageID, *gf_core.GFerror)
- type GFimageNewInfo
- type GFimageThumbs
- type GFmetrics
- type GFserviceInfo
- type GFshareInput
- type Gf_image_id
- type ImageFetchError
Constants ¶
View Source
const ( GF_EVENT_APP__IMAGE_UPLOAD_INIT = "GF_EVENT_APP__IMAGE_UPLOAD_INIT" GF_EVENT_APP__IMAGE_UPLOAD_COMPLETE = "GF_EVENT_APP__IMAGE_UPLOAD_COMPLETE" GF_ENVET_APP__IMAGE_SHARE = "GF_ENVET_APP__IMAGE_SHARE" GF_EVENT_APP__IMAGE_CLASSIFY = "GF_EVENT_APP__IMAGE_CLASSIFY" )
Variables ¶
This section is empty.
Functions ¶
func CLIparseArgs ¶
func CheckImageFormat ¶
func CheckImageFormat(pFormatStr string, pRuntimeSys *gf_core.RuntimeSys) bool
func DBmongoImageExists ¶
func DBmongoPutImage ¶
func DownloadFile ¶
func GetImageExtFromURL ¶
func GetImageLargerDimension ¶
func GetImageTitleFromURL ¶
func ImageGetFilepathFromID ¶
func ImageGetPublicURL ¶
func ImageGetPublicURL(pImageFilePathStr string, pMediaDomainStr string, pRuntimeSys *gf_core.RuntimeSys) string
returns the URL of a particular image path, this URL is where the image can be fetched from directly.
func ImageLoadFile ¶
func NormalizeImageFormat ¶
func RunClassify ¶
func RunPyClassify ¶
func S3getImage ¶
func S3getImageFilepath ¶
func S3getImageFilepath(pImageIDstr GFimageID, pImageFormatStr string, pRuntimeSys *gf_core.RuntimeSys) string
func S3getImageOriginalFileS3filepath ¶
func S3getImageOriginalFileS3filepath(p_image *GFimage, pRuntimeSys *gf_core.RuntimeSys) string
func S3storeImage ¶
func S3storeImage(pImageLocalFilePathStr string, pImageThumbs *GFimageThumbs, pS3bucketNameStr string, pS3info *gf_aws.GFs3Info, pRuntimeSys *gf_core.RuntimeSys) *gf_core.GFerror
func S3storeThumbnails ¶
func S3storeThumbnails(pImageThumbs *GFimageThumbs, pS3bucketNameStr string, pS3info *gf_aws.GFs3Info, pRuntimeSys *gf_core.RuntimeSys) *gf_core.GFerror
func SharePipeline ¶
func SharePipeline(pInput *GFshareInput, pUserID gf_core.GF_ID, pServiceInfo *GFserviceInfo, pCtx context.Context, pRuntimeSys *gf_core.RuntimeSys) *gf_core.GFerror
func StoreThumbnails ¶
func StoreThumbnails(pImageThumbs *GFimageThumbs, pStorage *gf_images_storage.GFimageStorage, pRuntimeSys *gf_core.RuntimeSys) *gf_core.GFerror
func ThumbsGetSizeInPx ¶
func TransformImage ¶
func TransformImage(pImageIDstr GFimageID, pImageClientTypeStr string, pImagesFlowsNamesLst []string, pImageOriginURLstr string, pImageOriginPageURLstr string, pMetaMap map[string]interface{}, pImageLocalFilePathStr string, pImagesStoreThumbnailsLocalDirPathStr string, pPluginsPyDirPathStr string, pPluginsMetrics *gf_images_plugins.GFmetrics, pUserID gf_core.GF_ID, pCtx context.Context, pRuntimeSys *gf_core.RuntimeSys) (*GFimage, *GFimageThumbs, *gf_core.GFerror)
pImageOriginPageURLstr - urls of pages (html or some other resource) where the image image_url
was found. this is valid for gf_chrome_ext image sources. its not relevant for direct image uploads from clients.
func TransformProcessImage ¶
func TransformProcessImage(pImageIDstr GFimageID, pImageClientTypeStr string, pImagesFlowsNamesLst []string, pImageOriginURLstr string, pImageOriginPageURLstr string, pMetaMap map[string]interface{}, pNormalizedExtStr string, pImageLocalFilePathStr string, pImagesStoreThumbnailsLocalDirPathStr string, pUserID gf_core.GF_ID, pCtx context.Context, pRuntimeSys *gf_core.RuntimeSys) (*GFimage, *GFimageThumbs, *gf_core.GFerror)
func TransformProcessImageV2 ¶
func VerifyImageInfo ¶
Types ¶
type GF_image_id ¶
type GF_image_id = Gf_image_id
type GFconfig ¶
type GFconfig struct { ImagesStoreLocalDirPathStr string `yaml:"store_local_dir_path"` ImagesThumbnailsStoreLocalDirPathStr string `yaml:"thumbnails_store_local_dir_path"` VideoStoreLocalDirPathStr string `yaml:"videos_store_local_dir_path"` MediaDomainStr string `yaml:"media_domain"` MainS3bucketNameStr string `yaml:"main_s3_bucket_name"` EmailSharingSenderAddressStr string `yaml:"email_sharing_sender_address"` // UPLOADED_IMAGES - this is a special dedicated bucket, separate from buckets for all other flows. // Mainly because users are pushing data to it directly and so we want to possibly handle // it in a separate way from other buckets that only have internal GF systems // uploading data to it. Uploaded_images_s3_bucket_str string `yaml:"uploaded_images_s3_bucket"` // BOOKMARKS_IMAGES - dedicated bucket for screenshots of bookmarks Bookmark_images_s3_bucket_str string `yaml:"bookmark_images_s3_bucket"` ImagesFlowToS3bucketDefaultStr string `yaml:"images_flow_to_s3_bucket_default"` ImagesFlowToS3bucketMap map[string]string `yaml:"images_flow_to_s3_bucket"` UseNewStorageEngineBool bool `yaml:"use_new_storage_engine"` //------------------------ // IPFS IPFSnodeHostStr string `yaml:"ipfs_node_host"` //------------------------ // PY //------------------------ // PLUGINGS PluginsPyDirPathStr string `yaml:"plugins_py_dir_path"` // IMAGE_CLASSIFY ImagesClassifyPyDirPathStr string `yaml:"images_classify_py_dir_path"` }
type GFimage ¶
type GFimage struct { Id primitive.ObjectID `json:"-" bson:"_id,omitempty"` IDstr GFimageID `json:"id_str" bson:"id_str"` T_str string `json:"-" bson:"t"` // "img" Creation_unix_time_f float64 `json:"creation_unix_time_f" bson:"creation_unix_time_f"` UserID gf_core.GF_ID `json:"user_id_str" bson:"user_id_str"` //--------------- ClientTypeStr string `json:"-" bson:"client_type_str"` // "gchrome_ext"|"gf_crawl_images"|"gf_image_editor" TitleStr string `json:"title_str" bson:"title_str"` FlowsNamesLst []string `json:"flows_names_lst" bson:"flows_names_lst"` // image can bellong to multiple flows //--------------- /* RESOLVED_SOURCE_URL IMPORTANT!! - when the image comes from an external url (as oppose to it being created internally, or uploaded directly to the system). this is different from Origin_page_url_str in that the page_url is the url of the page in which the image is found, whereas this origin_url is the url of the file on some file server from which the image is served */ Origin_url_str string `json:"origin_url_str" bson:"origin_url_str"` // if the image is extracted from a page, this holds the page_url Origin_page_url_str string `json:"origin_page_url_str,omitempty" bson:"origin_page_url_str,omitempty"` /* DEPRECATED!! - is this used? images are stored in S3, and accessible via URL. actual path on the OS filesystem, of the fullsized image gotten from origin_url_str durring processing (download/transformation/s3_upload). */ Original_file_internal_uri_str string `json:"original_file_internal_uri_str,omitempty" bson:"original_file_internal_uri_str,omitempty"` ThumbnailSmallURLstr string `json:"thumbnail_small_url_str" bson:"thumbnail_small_url_str"` ThumbnailMediumURLstr string `json:"thumbnail_medium_url_str" bson:"thumbnail_medium_url_str"` ThumbnailLargeURLstr string `json:"thumbnail_large_url_str" bson:"thumbnail_large_url_str"` //--------------- Format_str string `json:"format_str" bson:"format_str"` // "jpeg" | "png" | "gif" Width_int int `json:"width_str" bson:"width_int"` Height_int int `json:"height_str" bson:"height_int"` //--------------- // COLORS DominantColorHexStr string `json:"dominant_color_hex_str" bson:"dominant_color_hex_str"` PalleteStr string `json:"pallete_str" bson:"pallete_str"` //--------------- // META MetaMap map[string]interface{} `json:"meta_map" bson:"meta_map"` // metadata external users might assign to an image TagsLst []string `json:"tags_lst" bson:"tags_lst"` // human facing tags assigned to an image }
func CreateTestImages ¶
func DBmongoGetImage ¶
func ImageCreateNew ¶
func ImageCreateNew(pImageInfo *GFimageNewInfo, pCtx context.Context, pRuntimeSys *gf_core.RuntimeSys) (*GFimage, *gf_core.GFerror)
type GFimageExport ¶
type GFimageExport struct { Creation_unix_time_f float64 `json:"creation_unix_time_f"` UserNameStr gf_identity_core.GFuserName `json:"user_name_str"` Title_str string `json:"title_str"` Flows_names_lst []string `json:"flows_names_lst"` Origin_page_url_str string `json:"origin_page_url_str"` ThumbnailSmallURLstr string `json:"thumbnail_small_url_str"` ThumbnailMediumURLstr string `json:"thumbnail_medium_url_str"` ThumbnailLargeURLstr string `json:"thumbnail_large_url_str"` Format_str string `json:"format_str"` Tags_lst []string `json:"tags_lst"` }
type GFimageID ¶
type GFimageID = GF_image_id
func CreateIDfromURL ¶
func CreateImageID ¶
func CreateImageID(pImageURIstr string, pRuntimeSys *gf_core.RuntimeSys) GFimageID
type GFimageNewInfo ¶
type GFimageNewInfo struct { IDstr GFimageID Title_str string Flows_names_lst []string Image_client_type_str string Origin_url_str string Origin_page_url_str string Original_file_internal_uri_str string ThumbnailSmallURLstr string ThumbnailMediumURLstr string ThumbnailLargeURLstr string Format_str string Width_int int Height_int int Meta_map map[string]interface{} // user that owns this image, that uploaded or added it in some other way UserID gf_core.GF_ID }
type GFimageThumbs ¶
type GFimageThumbs struct { Small_relative_url_str string `json:"small_relative_url_str"` Medium_relative_url_str string `json:"medium_relative_url_str"` Large_relative_url_str string `json:"large_relative_url_str"` Small_local_file_path_str string Medium_local_file_path_str string Large_local_file_path_str string }
func CreateThumbnails ¶
type GFmetrics ¶
type GFmetrics struct { // IMAGE_UPLOAD ImageUploadClientDurationGauge prometheus.Gauge ImageUploadClientTransferDurationGauge prometheus.Gauge // IMAGE_CLASSIFY ImageClassifyPyExecDurationGauge prometheus.Gauge }
func MetricsCreate ¶
type GFserviceInfo ¶
type GFserviceInfo struct { Port_str string DomainBaseStr string // DB Mongodb_host_str string Mongodb_db_name_str string ImagesStoreLocalDirPathStr string ImagesThumbnailsStoreLocalDirPathStr string VideoStoreLocalDirPathStr string MediaDomainStr string ImagesMainS3bucketNameStr string TemplatesPathsMap map[string]string ConfigFilePathStr string // email address from which image sharing emails are sent EmailSharingSenderAddressStr string //------------------------ // AUTH_SUBSYSTEM_TYPE AuthSubsystemTypeStr string // AUTH_LOGIN_URL - url of the login page to which the system should // redirect users when email is confirmed. AuthLoginURLstr string KeyServer *gf_identity_core.GFkeyServerInfo // NEW_STORAGE_ENGINE - flag indicating if the new image storage engine should be used UseNewStorageEngineBool bool // IPFS_NODE_HOST - host/gateway to use to connect to for IPFS operations IPFSnodeHostStr string // EVENTS_APP - enable sending of app events from various functions EnableEventsAppBool bool }
type GFshareInput ¶
type GFshareInput struct {}
type Gf_image_id ¶
type Gf_image_id string // DEPRECATED!! - switch to using GF_image_id fully
type ImageFetchError ¶
type ImageFetchError struct { Id primitive.ObjectID `json:"-" bson:"_id,omitempty"` Id_str string `json:"id_str" bson:"id_str"` T_str string `json:"-" bson:"t"` // img_fetch_error Creation_unix_time_f float64 `json:"creation_unix_time_f" bson:"creation_unix_time_f"` Image_url_str string `json:"image_url_str" bson:"image_url_str"` Status_code_int int `json:"status_code_int" bson:"status_code_int"` }
Source Files ¶
- gf_events.go
- gf_image_config.go
- gf_image_verify.go
- gf_images.go
- gf_images_classify.go
- gf_images_cli.go
- gf_images_db_mongo.go
- gf_images_db_sql.go
- gf_images_fetcher.go
- gf_images_id.go
- gf_images_s3.go
- gf_images_share.go
- gf_images_thumbs.go
- gf_images_transformer.go
- gf_images_utils.go
- gf_metrics.go
- t__utils.go
Click to show internal directories.
Click to hide internal directories.