gf_images_storage

package
v0.0.0-...-a1b0e2b Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileCopy

func FileCopy(pOpDef *GFcopyOpDef,
	pStorage *GFimageStorage,
	pRuntimeSys *gf_core.RuntimeSys) *gf_core.GFerror

func FileGeneratePresignedURL

func FileGeneratePresignedURL(pOpDef *GFgeneratePresignedURLopDef,
	pStorage *GFimageStorage,
	pRuntimeSys *gf_core.RuntimeSys) (string, *gf_core.GFerror)

func FileGet

func FileGet(pOpDef *GFgetOpDef,
	pStorage *GFimageStorage,
	pRuntimeSys *gf_core.RuntimeSys) *gf_core.GFerror

func FilePutFromLocal

func FilePutFromLocal(pOpDef *GFputFromLocalOpDef,
	pStorage *GFimageStorage,
	pRuntimeSys *gf_core.RuntimeSys) *gf_core.GFerror

Types

type GFcopyOpDef

type GFcopyOpDef struct {
	ImageSourceFilePathStr    string
	SourceFileS3bucketNameStr string
	ImageTargetFilePathStr    string
	TargetFileS3bucketNameStr string
}

type GFgeneratePresignedURLopDef

type GFgeneratePresignedURLopDef struct {
	TargetFilePathStr         string
	TargetFileS3bucketNameStr string
}

type GFgetOpDef

type GFgetOpDef struct {
	ImageSourceFilePathStr      string
	ImageTargetLocalFilePathStr string
	S3bucketNameStr             string
}

type GFimageStorage

type GFimageStorage struct {
	TypeStr string // "local" | "s3" | "ipfs"
	Local   *GFstorageLocal
	S3      *GFstorageS3
	IPFS    *GFstorageIPFS
}

func Init

func Init(pConfig *GFimageStorageConfig,
	pRuntimeSys *gf_core.RuntimeSys) (*GFimageStorage, *gf_core.GFerror)

type GFimageStorageConfig

type GFimageStorageConfig struct {
	TypesToProvisionLst []string // list of storage types to initialize
	IPFSnodeHostStr     string

	// LOCAL_DIRS
	ThumbsDirPathStr        string
	UploadsSourceDirPathStr string
	UploadsTargetDirPathStr string
	ExternImagesDirPathStr  string

	// S3_BUCKETS
	ThumbsS3bucketNameStr        string
	UploadsSourceS3bucketNameStr string
	UploadsTargetS3bucketNameStr string
	ExternImagesS3bucketNameStr  string
}

type GFputFromLocalOpDef

type GFputFromLocalOpDef struct {
	ImageSourceLocalFilePathStr string
	ImageTargetFilePathStr      string
	S3bucketNameStr             string
}

type GFstorageIPFS

type GFstorageIPFS struct {
	Shell *ipfs.Shell
}

type GFstorageLocal

type GFstorageLocal struct {
	ThumbsDirPathStr        string
	UploadsSourceDirPathStr string
	UploadsTargetDirPathStr string
	ExternImagesDirPathStr  string
}

type GFstorageS3

type GFstorageS3 struct {
	Info                         *gf_aws.GFs3Info
	ThumbsS3bucketNameStr        string
	UploadsSourceS3bucketNameStr string
	UploadsTargetS3bucketNameStr string
	ExternImagesS3bucketNameStr  string
}

Jump to

Keyboard shortcuts

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