api

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToOSFileMode

func ToOSFileMode(m FileMode) fs.FileMode

Types

type BadReq

type BadReq struct {
	Message          string `json:"message"`
	DocumentationUrl string `json:"documentation_url"`
}

type Blobl

type Blobl struct {
	SHA      string `json:"sha"`
	NodeID   string `json:"node_id"`
	URL      string `json:"url"`
	Content  string `json:"content"`
	Encoding string `json:"encoding"`
	Size     int64  `json:"size"`
}

type Clint

type Clint struct {
	HTTPClint  *http.Client
	GitRepoUrl string
	GitToken   string
}

func NewClint

func NewClint() *Clint

func (*Clint) GetCountents

func (c *Clint) GetCountents(url *string) ([]TreeElement, error)

type FileMode

type FileMode int

TreeElement.go

const (
	FileModeEmpty      FileMode = 0
	FileModeTree       FileMode = 40000
	FileModeBlob       FileMode = 100644
	FileModeExec       FileMode = 100755
	FileModeSymlink    FileMode = 120000
	FileModeCommit     FileMode = 160000
	FileModeDeprecated FileMode = 100664
)

There are only a few file modes in Git. They look like unix file modes, but they can only be one of these. 040000

type FileType

type FileType string
const (
	Blob     FileType = "blob"
	TypeTree FileType = "tree"
)

type Tree

type Tree struct {
	SHA       string        `json:"sha"`
	URL       string        `json:"url"`
	Tree      []TreeElement `json:"tree"`
	Truncated bool          `json:"truncated"`
}

type TreeElement

type TreeElement struct {
	Size *int64   `json:"size,omitempty"`
	URL  *string  `json:"url"`
	Path string   `json:"path"`
	Type FileType `json:"type"`
	SHA  string   `json:"sha"`
	Mode FileMode `json:"mode,string"`
}

Jump to

Keyboard shortcuts

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