Documentation
¶
Overview ¶
Provides basic internal utilities for geard.
Index ¶
- Variables
- func AtomicReplaceLink(from, target string) error
- func AtomicWriteToContentPath(path string, mode os.FileMode, value []byte) error
- func CreateFileExclusive(path string, mode os.FileMode) (*os.File, error)
- func CreateFileOnce(path string, data []byte, perm os.FileMode) error
- func EncodeUrlPath(s string) string
- func IsolateContentPath(base, id, suffix string) string
- func IsolateContentPathWithPerm(base, id, suffix string, perm os.FileMode) string
- func LimitWriter(w io.Writer, n int64) io.Writer
- func NewWriteFlusher(w io.Writer) io.Writer
- func OpenFileExclusive(path string, mode os.FileMode) (*os.File, bool, error)
- func TakePrefix(s string, prefix string) (string, bool)
- func TakeSegment(path string) (string, string, bool)
- func WriteToPathExclusive(path string, source io.WriterTo, mode os.FileMode) error
- type ErrorOnce
- type EscapeError
- type Fingerprint
- type LimitedWriter
- type RawMessage
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrContentMismatch = errors.New("File content does not match expected value")
View Source
var ErrLockTaken = errors.New("An exclusive lock already exists on the specified file.")
Functions ¶
func AtomicReplaceLink ¶
func CreateFileExclusive ¶
func EncodeUrlPath ¶
func IsolateContentPath ¶
func NewWriteFlusher ¶
* Return an io.Writer that will flush after every write.
func OpenFileExclusive ¶
Types ¶
type EscapeError ¶
type EscapeError string
func (EscapeError) Error ¶
func (e EscapeError) Error() string
type Fingerprint ¶
type Fingerprint []byte
func (Fingerprint) ToShortName ¶
func (f Fingerprint) ToShortName() string
type LimitedWriter ¶
type RawMessage ¶
type RawMessage []byte
https://code.google.com/p/go/issues/detail?id=6528
func (RawMessage) MarshalJSON ¶
func (m RawMessage) MarshalJSON() ([]byte, error)
func (*RawMessage) UnmarshalJSON ¶
func (m *RawMessage) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.