Documentation ¶
Index ¶
Constants ¶
const FinalMode = 0664
The final permissions of the cache files, once they have finished being uploaded.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Creator ¶
type Creator struct {
// contains filtered or unexported fields
}
Creator maintains the state of a pseudo-random number generator used to create temp files.
func NewCreator ¶
func NewCreator() *Creator
NewCreator returns a new Creator, for creating temp files.
func (*Creator) Create ¶
Create attempts to create a file whose name is of the form <base>-<randomstring> and with a ".v1" suffix if `legacy` is true. The file will be created with the setgid bit set, which indicates that it is not complete. The *os.File is returned along with the random string, and an error if something went wrong.
Once the file has been successfully written by the caller, it should be chmod'ed to `FinalMode` to mark it as complete.