Documentation ¶
Index ¶
- func BatchHandler(ctx *context.Context)
- func GetListLockHandler(ctx *context.Context)
- func IsErrRangeNotSatisfiable(err error) bool
- func IsPointerFile(buf *[]byte) *models.LFSMetaObject
- func MetaMatcher(r macaron.Request) bool
- func ObjectOidHandler(ctx *context.Context)
- func PostHandler(ctx *context.Context)
- func PostLockHandler(ctx *context.Context)
- func PutHandler(ctx *context.Context)
- func ReadMetaObject(meta *models.LFSMetaObject) (io.ReadCloser, error)
- func ReadPointerFile(reader io.Reader) (*models.LFSMetaObject, *[]byte)
- func UnLockHandler(ctx *context.Context)
- func VerifyHandler(ctx *context.Context)
- func VerifyLockHandler(ctx *context.Context)
- type BatchResponse
- type BatchVars
- type Claims
- type ContentStore
- func (s *ContentStore) Exists(meta *models.LFSMetaObject) (bool, error)
- func (s *ContentStore) Get(meta *models.LFSMetaObject, fromByte int64) (io.ReadCloser, error)
- func (s *ContentStore) Put(meta *models.LFSMetaObject, r io.Reader) error
- func (s *ContentStore) Verify(meta *models.LFSMetaObject) (bool, error)
- type ErrRangeNotSatisfiable
- type ObjectError
- type Representation
- type RequestVars
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetListLockHandler ¶ added in v1.4.0
GetListLockHandler list locks
func IsErrRangeNotSatisfiable ¶ added in v1.13.0
IsErrRangeNotSatisfiable returns true if the error is an ErrRangeNotSatisfiable
func IsPointerFile ¶ added in v1.8.0
func IsPointerFile(buf *[]byte) *models.LFSMetaObject
IsPointerFile will return a partially filled LFSMetaObject if the provided byte slice is a pointer file
func MetaMatcher ¶
MetaMatcher provides a mux.MatcherFunc that only allows requests that contain an Accept header with the metaMediaType
func ObjectOidHandler ¶
ObjectOidHandler is the main request routing entry point into LFS server functions
func PostHandler ¶
PostHandler instructs the client how to upload data
func PostLockHandler ¶ added in v1.4.0
PostLockHandler create lock
func PutHandler ¶
PutHandler receives data from the client and puts it into the content store
func ReadMetaObject ¶ added in v1.8.0
func ReadMetaObject(meta *models.LFSMetaObject) (io.ReadCloser, error)
ReadMetaObject will read a models.LFSMetaObject and return a reader
func ReadPointerFile ¶ added in v1.8.0
func ReadPointerFile(reader io.Reader) (*models.LFSMetaObject, *[]byte)
ReadPointerFile will return a partially filled LFSMetaObject if the provided reader is a pointer file
func UnLockHandler ¶ added in v1.4.0
UnLockHandler delete locks
func VerifyHandler ¶ added in v1.3.0
VerifyHandler verify oid and its size from the content store
func VerifyLockHandler ¶ added in v1.4.0
VerifyLockHandler list locks for verification
Types ¶
type BatchResponse ¶
type BatchResponse struct { Transfer string `json:"transfer,omitempty"` Objects []*Representation `json:"objects"` }
BatchResponse contains multiple object metadata Representation structures for use with the batch API.
type BatchVars ¶
type BatchVars struct { Transfers []string `json:"transfers,omitempty"` Operation string `json:"operation"` Objects []*RequestVars `json:"objects"` }
BatchVars contains multiple RequestVars processed in one batch operation. https://github.com/git-lfs/git-lfs/blob/master/docs/api/batch.md
type ContentStore ¶
type ContentStore struct {
storage.ObjectStorage
}
ContentStore provides a simple file system based storage.
func (*ContentStore) Exists ¶
func (s *ContentStore) Exists(meta *models.LFSMetaObject) (bool, error)
Exists returns true if the object exists in the content store.
func (*ContentStore) Get ¶
func (s *ContentStore) Get(meta *models.LFSMetaObject, fromByte int64) (io.ReadCloser, error)
Get takes a Meta object and retrieves the content from the store, returning it as an io.Reader. If fromByte > 0, the reader starts from that byte
func (*ContentStore) Put ¶
func (s *ContentStore) Put(meta *models.LFSMetaObject, r io.Reader) error
Put takes a Meta object and an io.Reader and writes the content to the store.
func (*ContentStore) Verify ¶ added in v1.3.0
func (s *ContentStore) Verify(meta *models.LFSMetaObject) (bool, error)
Verify returns true if the object exists in the content store and size is correct.
type ErrRangeNotSatisfiable ¶ added in v1.13.0
type ErrRangeNotSatisfiable struct {
FromByte int64
}
ErrRangeNotSatisfiable represents an error which request range is not satisfiable.
func (ErrRangeNotSatisfiable) Error ¶ added in v1.13.0
func (err ErrRangeNotSatisfiable) Error() string
type ObjectError ¶
ObjectError defines the JSON structure returned to the client in case of an error
type Representation ¶
type Representation struct { Oid string `json:"oid"` Size int64 `json:"size"` Actions map[string]*link `json:"actions"` Error *ObjectError `json:"error,omitempty"` }
Representation is object metadata as seen by clients of the lfs server.
func Represent ¶
func Represent(rv *RequestVars, meta *models.LFSMetaObject, download, upload bool) *Representation
Represent takes a RequestVars and Meta and turns it into a Representation suitable for json encoding
type RequestVars ¶
type RequestVars struct { Oid string Size int64 User string Password string Repo string Authorization string }
RequestVars contain variables from the HTTP request. Variables from routing, json body decoding, and some headers are stored.
func (*RequestVars) ObjectLink ¶
func (v *RequestVars) ObjectLink() string
ObjectLink builds a URL linking to the object.
func (*RequestVars) VerifyLink ¶ added in v1.3.0
func (v *RequestVars) VerifyLink() string
VerifyLink builds a URL for verifying the object.