protocol

package
v0.0.0-...-2e0f99f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

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

func (c *Claim) GetFilesIds() []string

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 ClaimMode

type ClaimMode int32

ClaimMode is the mode in which a file is claimed

const (
	UNCLAIMED ClaimMode = 0
	EXCLUSIVE ClaimMode = 1
	SHARED    ClaimMode = 2
)

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

func NewFileInfoFromModel(fi *domain.FileInfo) *FileInfo

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 Release

type Release struct {
	BranchName string   `json:"branchName"`
	FileIds    []string `json:"fileIds"`
}

Release is a request to release files

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

func (u *Update) GetFilesIds() []string

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL