{"modulePath":"github.com/CHESSComputing/DataManagement","version":"v0.4.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package main\n\n## Variables\n\n```go\nvar StaticFs embed.FS\n```\ncontent is our static web server content.\n\n## Functions\n\n```go\nfunc DataFilesHandler(c *gin.Context)\n```\nDataFilesHandler provides access to data files\n\n```go\nfunc DataLocationHandler(c *gin.Context)\n```\nGET handlers\n\n```go\nfunc FsDeleteHandler(c *gin.Context)\n```\nFsDeleteHandler provides access to DELETE /storate/:dir end-point\n\n\\`\\`\\` curl -X DELETE [http://localhost:8340/storage/dir](http://localhost:8340/storage/dir) curl -X DELETE [http://localhost:8340/storage/dir/archive.zip](http://localhost:8340/storage/dir/archive.zip) \\`\\`\\`\n\n```go\nfunc FsPostHandler(c *gin.Context)\n```\nFsPostHandler provides access to POST /storate/:dir end-point\n\n\\`\\`\\` curl -X POST [http://localhost:8340/storage/dir](http://localhost:8340/storage/dir)\n\n\tcurl -X POST http://localhost:8340/storage/dir/archive.zip \\\n\t     -F \"file=@/path/test.zip\" \\\n\t     -H \"Content-Type: multipart/form-data\"\n\t ```\n\n```go\nfunc FsStorageHandler(c *gin.Context)\n```\nFsStorageHandler provides access to GET /storage/:dir/:file end-point\n\n\\`\\`\\` # get list of storage curl [http://localhost:8340/storage](http://localhost:8340/storage) # get list of specific dir in a storage curl [http://localhost:8340/storage/dir](http://localhost:8340/storage/dir) # get concrete file from storage dir curl [http://localhost:8340/storage/dir/archive.zip](http://localhost:8340/storage/dir/archive.zip) \\`\\`\\`\n\n```go\nfunc S3DeleteHandler(c *gin.Context)\n```\nS3DeleteHandler provides access to DELETE /storate/:bucket end-point\n\n\\`\\`\\` curl -X DELETE [http://localhost:8340/storage/s3-bucket](http://localhost:8340/storage/s3-bucket) curl -X DELETE [http://localhost:8340/storage/s3-bucket/archive.zip](http://localhost:8340/storage/s3-bucket/archive.zip) \\`\\`\\`\n\n```go\nfunc S3PostHandler(c *gin.Context)\n```\nS3PostHandler provides access to POST /storate/:bucket end-point\n\n\\`\\`\\` curl -X POST [http://localhost:8340/storage/s3-bucket](http://localhost:8340/storage/s3-bucket)\n\n\tcurl -X POST http://localhost:8340/storage/s3-bucket/archive.zip \\\n\t     -F \"file=@/path/test.zip\" \\\n\t     -H \"Content-Type: multipart/form-data\"\n\t ```\n\n```go\nfunc S3StorageHandler(c *gin.Context)\n```\nS3StorageHandler provides access to GET /storage/:bucket/:object end-point\n\n\\`\\`\\` # get list of storage curl [http://localhost:8340/storage](http://localhost:8340/storage) # get list of specific bucket in a storage curl [http://localhost:8340/storage/s3-bucket](http://localhost:8340/storage/s3-bucket) # get concrete object from storage bucket curl [http://localhost:8340/storage/s3-bucket/archive.zip](http://localhost:8340/storage/s3-bucket/archive.zip) \\`\\`\\`\n\n```go\nfunc Server()\n```\nServer defines our HTTP server\n\n## Types\n\n```go\ntype BucketParams struct {\n\tBucket string `uri:\"bucket\" binding:\"required\"`\n}\n```\nBucketParams represents site URI parameter for /storage/:bucket end-point\n\n```go\ntype FileEntry struct {\n\tDid    string `json:\"did\"`\n\tEscDid string `json:\"esc_did\"`\n\tName   string `json:\"name\"`\n\tIsDir  bool   `json:\"is_dir\"`\n\tPath   string `json:\"path\"` // path here correspond to sub-path within raw location area\n}\n```\nFileEntry represents a directory entry\n\n```go\nfunc (e FileEntry) IsViewable() bool\n```\n\n```go\ntype FileStorageParams struct {\n\tStorageParams\n\tFile string `uri:\"file\" binding:\"required\"`\n}\n```\nFileStorageParams represents site URI parameter for /storage/:dir/:file end-point\n\n```go\ntype FsClient interface {\n\tGet(dir, file string) ([]byte, error)\n\tList(dir string) ([]Metadata, error)\n\tCreate(dir string) error\n\tUpload(dir, file, ctype string, reader io.Reader, size int64) error\n\tDelete(dir, file string) error\n}\n```\nFsClient represents generic interface to communicate with FileSystem instances\n\n```go\ntype LocalFsClient struct {\n\tStorage string\n\tLogger  *log.Logger\n}\n```\nLocalFsClient provides local file system implementation of FsClient\n\n```go\nfunc NewLocalFsClient(storage string) *LocalFsClient\n```\nNewLocalFsClient creates a new LocalFsClient with logging enabled\n\n```go\nfunc (l *LocalFsClient) Create(dir string) error\n```\nCreate creates a new directory\n\n```go\nfunc (l *LocalFsClient) Delete(dir, file string) error\n```\nDelete removes a file or an entire directory if file is empty\n\n```go\nfunc (l *LocalFsClient) Get(dir, file string) ([]byte, error)\n```\nGet retrieves a file's content or lists directory contents if file is empty\n\n```go\nfunc (l *LocalFsClient) List(dir string) ([]Metadata, error)\n```\nList retrieves metadata for all files in a given directory\n\n```go\nfunc (l *LocalFsClient) Upload(dir, file, ctype string, reader io.Reader, size int64) error\n```\nUpload writes data to a file in chunks to handle large files efficiently\n\n```go\ntype Metadata struct {\n\tName        string    `json:\"name\"`\n\tSize        int64     `json:\"size\"`\n\tModTime     time.Time `json:\"mod_time\"`\n\tIsDirectory bool      `json:\"is_directory\"`\n}\n```\nMetadata represents file metadata information\n\n```go\ntype ObjectParams struct {\n\tBucketParams\n\tObject string `uri:\"object\" binding:\"required\"`\n}\n```\nObjectParams represents site URI parameter for /storage/:bucket/:object end-point\n\n```go\ntype StorageParams struct {\n\tDir string `uri:\"dir\" binding:\"required\"`\n}\n```\nStorageParams represents site URI parameter for /storage/:dir end-point\n\n","path":"github.com/CHESSComputing/DataManagement","name":"main","synopsis":"","isRedistributable":true}
