models

package
v0.0.0-...-e973027 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: Apache-2.0 Imports: 5 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BranchToKey

func BranchToKey(b *Branch) string

func GetFiles

func GetFiles(b Branch, fileName string, summary bool) (FilesInfo, IModelError)

func ParseBranch

func ParseBranch(s string) (Branch, IModelError)

Types

type Branch

type Branch = dbmodels.Branch

type File

type File = dbmodels.File

type FileDeleteOption

type FileDeleteOption struct {
	Branch
	Files []FilePath `json:"files" required:"true"`
}

func (*FileDeleteOption) DeleteFiles

func (f *FileDeleteOption) DeleteFiles() IModelError

func (*FileDeleteOption) Validate

func (f *FileDeleteOption) Validate() IModelError

type FilePath

type FilePath = dbmodels.FilePath

type FileUpdateOption

type FileUpdateOption struct {
	Branch
	FilesInfo
}

func (*FileUpdateOption) Update

func (f *FileUpdateOption) Update() IModelError

func (*FileUpdateOption) Validate

func (f *FileUpdateOption) Validate() IModelError

type FilesInfo

type FilesInfo struct {
	BranchSHA string `json:"branch_sha" required:"true"`
	Files     []File `json:"files" required:"true"`
}

type IModelError

type IModelError interface {
	Error() string
	ErrCode() ModelErrCode
	IsErrorOf(ModelErrCode) bool
}

type ModelErrCode

type ModelErrCode string
const (
	ErrSystemError      ModelErrCode = "error_system_error"
	ErrUnknownDBError   ModelErrCode = "error_unknown_db_error"
	ErrNotSameFile      ModelErrCode = "error_not_same_file"
	ErrHasSameFile      ModelErrCode = "error_has_same_file"
	ErrMissingParam     ModelErrCode = "error_missing_input_param"
	ErrInvalidBranchKey ModelErrCode = "error_invalid_branch_key"
)

Jump to

Keyboard shortcuts

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