1
// Copyright 2020 The Gitea Authors. All rights reserved.
2
// SPDX-License-Identifier: MIT
11
// MediaType contains the media type for LFS server requests
12
MediaType = "application/vnd.git-lfs+json"
15
// BatchRequest contains multiple requests processed in one batch operation.
16
// https://github.com/git-lfs/git-lfs/blob/main/docs/api/batch.md#requests
17
type BatchRequest struct {
18
Operation string `json:"operation"`
19
Transfers []string `json:"transfers,omitempty"`
20
Ref *Reference `json:"ref,omitempty"`
21
Objects []Pointer `json:"objects"`
24
// Reference contains a git reference.
25
// https://github.com/git-lfs/git-lfs/blob/main/docs/api/batch.md#ref-property
26
type Reference struct {
27
Name string `json:"name"`
30
// Pointer contains LFS pointer data
32
Oid string `json:"oid" xorm:"UNIQUE(s) INDEX NOT NULL"`
33
Size int64 `json:"size" xorm:"NOT NULL"`
36
// BatchResponse contains multiple object metadata Representation structures
37
// for use with the batch API.
38
// https://github.com/git-lfs/git-lfs/blob/main/docs/api/batch.md#successful-responses
39
type BatchResponse struct {
40
Transfer string `json:"transfer,omitempty"`
41
Objects []*ObjectResponse `json:"objects"`
44
// ObjectResponse is object metadata as seen by clients of the LFS server.
45
type ObjectResponse struct {
47
Actions map[string]*Link `json:"actions,omitempty"`
48
Error *ObjectError `json:"error,omitempty"`
51
// Link provides a structure with information about how to access a object.
53
Href string `json:"href"`
54
Header map[string]string `json:"header,omitempty"`
55
ExpiresAt *time.Time `json:"expires_at,omitempty"`
58
// ObjectError defines the JSON structure returned to the client in case of an error.
59
type ObjectError struct {
60
Code int `json:"code"`
61
Message string `json:"message"`
64
// PointerBlob associates a Git blob with a Pointer.
65
type PointerBlob struct {
70
// ErrorResponse describes the error to the client.
71
type ErrorResponse struct {
73
DocumentationURL string `json:"documentation_url,omitempty"`
74
RequestID string `json:"request_id,omitempty"`