Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Claim ¶
type Claim struct {
SoftClaim bool `json:"softClaim"`
BranchName string `json:"branchName"`
Files []*ClaimInfo `json:"files"`
}
Claim is a request to claim files Implements FileRequests interface
func (*Claim) GetFilesIds ¶
GetFilesIds returns the file IDs from the request
type ClaimInfo ¶
type ClaimInfo struct {
FileId string `json:"fileId"`
FileHash string `json:"fileHash"`
ClaimMode ClaimMode `json:"claimMode"`
}
ClaimInfo contains the information needed to claim a file
type FileInfo ¶
type FileInfo struct {
FileId string `json:"fileId"`
FileHash string `json:"fileHash"`
UserIds []string `json:"userIds"`
BranchName string `json:"branchName"`
ClaimMode ClaimMode `json:"claimMode"`
RejectReason RejectReason `json:"rejectReason"`
}
FileInfo represents the information sent to the client about a file
func NewFileInfoFromModel ¶
type FilesRequest ¶
type FilesRequest interface {
GetFilesIds() []string
}
FilesRequest is an interface for requests that contain files
type RejectReason ¶
type RejectReason int32
RejectReason is the reason a claim was rejected
const ( NONE RejectReason = 0 ALREADY_CLAIMED RejectReason = 1 OUT_OF_DATE RejectReason = 2 NOT_OWNER RejectReason = 3 INVALID_CLAIM_MODE RejectReason = 4 MISSING RejectReason = 5 )
type Update ¶
type Update struct {
BranchName string `json:"branchName"`
Files []*UpdateFileInfo `json:"files"`
}
Update is a request to update files Implements FileRequests interface
func (*Update) GetFilesIds ¶
GetFilesIds returns the file IDs from the request
type UpdateFileInfo ¶
type UpdateFileInfo struct {
FileId string `json:"fileId"`
OldHash string `json:"oldHash"`
FileHash string `json:"fileHash"`
}
UpdateFileInfo contains the information needed to update a file
Click to show internal directories.
Click to hide internal directories.