mirror of
https://github.com/unidoc/unioffice.git
synced 2025-04-25 13:48:53 +08:00
34 lines
1.6 KiB
Go
34 lines
1.6 KiB
Go
//
|
|
// Copyright 2020 FoxyUtils ehf. All rights reserved.
|
|
//
|
|
// This is a commercial product and requires a license to operate.
|
|
// A trial license can be obtained at https://unidoc.io
|
|
//
|
|
// DO NOT EDIT: generated by unitwist Go source code obfuscator.
|
|
//
|
|
// Use of this source code is governed by the UniDoc End User License Agreement
|
|
// terms that can be accessed at https://unidoc.io/eula/
|
|
|
|
package tempstorage ;import _da "io";
|
|
|
|
// SetAsStorage changes temporary storage to newStorage.
|
|
func SetAsStorage (newStorage storage ){_cd =newStorage };
|
|
|
|
// TempFile creates new empty file in the storage and returns it.
|
|
func TempFile (dir ,pattern string )(File ,error ){return _cd .TempFile (dir ,pattern )};
|
|
|
|
// Open returns tempstorage File object by name.
|
|
func Open (path string )(File ,error ){return _cd .Open (path )};
|
|
|
|
// Add reads a file from a disk and adds it to the storage.
|
|
func Add (path string )error {return _cd .Add (path )};var _cd storage ;
|
|
|
|
// RemoveAll removes all files according to the dir argument prefix.
|
|
func RemoveAll (dir string )error {return _cd .RemoveAll (dir )};type storage interface{Open (_dab string )(File ,error );TempFile (_c ,_de string )(File ,error );TempDir (_cb string )(string ,error );RemoveAll (_e string )error ;Add (_daba string )error ;};
|
|
|
|
// File is a representation of a storage file
|
|
// with Read, Write, Close and Name methods identical to os.File.
|
|
type File interface{_da .Reader ;_da .ReaderAt ;_da .Writer ;_da .Closer ;Name ()string ;};
|
|
|
|
// TempDir creates a name for a new temp directory using a pattern argument.
|
|
func TempDir (pattern string )(string ,error ){return _cd .TempDir (pattern )}; |