Documentation ¶
Index ¶
- Variables
- type DefinitionLine
- type DefinitionReader
- type FileInvalidError
- type Manager
- func (m *Manager) AddRoutes(router *mux.Router, auther jwtauth.Authenticator)
- func (m *Manager) Close()
- func (m *Manager) EraseCheckout(checkoutID string) error
- func (m *Manager) PrepareCheckout(checkoutID string) (ResolvedCheckoutInfo, error)
- func (m *Manager) SymlinkToCheckout(blobPath, checkoutPath, symlinkRelativePath string) error
- type ResolvedCheckoutInfo
Constants ¶
This section is empty.
Variables ¶
var ( ErrCheckoutAlreadyExists = errors.New("A checkout with this ID already exists") ErrInvalidCheckoutID = errors.New("The Checkout ID is invalid") )
Errors returned by the Checkout Manager.
Functions ¶
This section is empty.
Types ¶
type DefinitionLine ¶
DefinitionLine is a single line in a checkout definition file.
type DefinitionReader ¶
DefinitionReader reads and parses a checkout definition
func NewDefinitionReader ¶
func NewDefinitionReader(ctx context.Context, reader io.Reader) *DefinitionReader
NewDefinitionReader creates a new DefinitionReader for the given reader.
func (*DefinitionReader) Read ¶
func (fr *DefinitionReader) Read() <-chan *DefinitionLine
Read spins up a new goroutine for parsing the checkout definition. The returned channel will receive definition lines.
type FileInvalidError ¶
type FileInvalidError struct {
// contains filtered or unexported fields
}
FileInvalidError is returned when there is an invalid line in a checkout definition file.
func (FileInvalidError) Error ¶
func (cfie FileInvalidError) Error() string
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager creates checkouts and provides info about missing files.
func NewManager ¶
NewManager creates and returns a new Checkout Manager.
func (*Manager) AddRoutes ¶
func (m *Manager) AddRoutes(router *mux.Router, auther jwtauth.Authenticator)
AddRoutes adds HTTP routes to the muxer.
func (*Manager) Close ¶
func (m *Manager) Close()
Close waits for still-running touch() calls to finish, then returns.
func (*Manager) EraseCheckout ¶
EraseCheckout removes the checkout directory structure identified by the ID.
func (*Manager) PrepareCheckout ¶
func (m *Manager) PrepareCheckout(checkoutID string) (ResolvedCheckoutInfo, error)
PrepareCheckout creates the root directory for a specific checkout. Returns the path relative to the checkout root directory.
func (*Manager) SymlinkToCheckout ¶
SymlinkToCheckout creates a symlink at symlinkPath to blobPath. It does *not* do any validation of the validity of the paths!
type ResolvedCheckoutInfo ¶
type ResolvedCheckoutInfo struct { // The path relative to the Manager.checkoutBasePath. This is what is // sent back to the client. RelativePath string // contains filtered or unexported fields }
ResolvedCheckoutInfo contains the result of validating the Checkout ID and parsing it into a final path.