unioffice/common/tempstorage/tempstorage.go

34 lines
1.6 KiB
Go
Raw Normal View History

2020-08-23 14:15:53 +00:00
//
// 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/
2020-10-12 13:59:12 +00:00
package tempstorage ;import _a "io";
2020-08-23 14:15:53 +00:00
2020-08-31 22:58:25 +00:00
// Open returns tempstorage File object by name.
2020-10-12 13:59:12 +00:00
func Open (path string )(File ,error ){return _b .Open (path )};type storage interface{Open (_gg string )(File ,error );TempFile (_ga ,_d string )(File ,error );TempDir (_da string )(string ,error );RemoveAll (_gc string )error ;Add (_f string )error ;};
2020-08-23 14:15:53 +00:00
2020-08-31 22:58:25 +00:00
// Add reads a file from a disk and adds it to the storage.
2020-10-12 13:59:12 +00:00
func Add (path string )error {return _b .Add (path )};
2020-08-31 22:58:25 +00:00
// File is a representation of a storage file
// with Read, Write, Close and Name methods identical to os.File.
2020-10-12 13:59:12 +00:00
type File interface{_a .Reader ;_a .Writer ;_a .Closer ;Name ()string ;};
2020-08-23 14:15:53 +00:00
// TempFile creates new empty file in the storage and returns it.
2020-10-12 13:59:12 +00:00
func TempFile (dir ,pattern string )(File ,error ){return _b .TempFile (dir ,pattern )};
2020-08-23 14:15:53 +00:00
2020-10-12 13:59:12 +00:00
// TempDir creates a name for a new temp directory using a pattern argument.
func TempDir (pattern string )(string ,error ){return _b .TempDir (pattern )};
2020-08-23 14:15:53 +00:00
2020-08-31 22:58:25 +00:00
// SetAsStorage changes temporary storage to newStorage.
2020-10-12 13:59:12 +00:00
func SetAsStorage (newStorage storage ){_b =newStorage };var _b storage ;
// RemoveAll removes all files according to the dir argument prefix.
func RemoveAll (dir string )error {return _b .RemoveAll (dir )};