coding

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessToken

type AccessToken struct {
	*Repository

	database.Model
	Secret  string
	Expires time.Time
}

func (*AccessToken) Table

func (*AccessToken) Table() string

type GitBlob

type GitBlob struct {
	Exists bool
	Branch string
	Path   string
	// contains filtered or unexported fields
}

func (*GitBlob) Close

func (blob *GitBlob) Close() error

func (*GitBlob) Content

func (blob *GitBlob) Content() (string, error)

func (*GitBlob) Dir

func (blob *GitBlob) Dir() string

func (*GitBlob) FileType

func (blob *GitBlob) FileType() string

func (*GitBlob) Files

func (blob *GitBlob) Files() ([]*GitBlob, error)

func (*GitBlob) IsDir

func (b *GitBlob) IsDir() bool

func (*GitBlob) IsImage

func (blob *GitBlob) IsImage() bool

func (*GitBlob) Lines

func (blob *GitBlob) Lines() ([]string, error)

func (*GitBlob) ModTime

func (*GitBlob) ModTime() time.Time

func (*GitBlob) Mode

func (blob *GitBlob) Mode() fs.FileMode

func (*GitBlob) Name

func (blob *GitBlob) Name() string

func (*GitBlob) Read

func (b *GitBlob) Read(v []byte) (int, error)

func (*GitBlob) Size

func (blob *GitBlob) Size() int64

func (*GitBlob) Stat

func (blob *GitBlob) Stat() (fs.FileInfo, error)

func (*GitBlob) Sys

func (*GitBlob) Sys() any

type GitRepo

type GitRepo struct {
	database.Model
	Name        string
	Description string
	Visibility  string
	UserID      string // Owner of the repository
}

func (*GitRepo) Blobs

func (repo *GitRepo) Blobs(branch, path string) (blobs []*GitBlob, err error)

func (*GitRepo) IsEmpty

func (repo *GitRepo) IsEmpty(branch string) bool

func (*GitRepo) Open

func (repo *GitRepo) Open(branch, path string) (*GitBlob, error)

func (*GitRepo) Path

func (repo *GitRepo) Path() string

func (*GitRepo) Run

func (repo *GitRepo) Run(args ...string) (stdout bytes.Buffer, stderr bytes.Buffer, err error)

func (*GitRepo) Table

func (*GitRepo) Table() string

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

func Manage

func Manage(db *database.DynamicDB) *Repository

func (*Repository) GetAccessToken

func (r *Repository) GetAccessToken(id, secret string) (*AccessToken, error)

func (*Repository) GetRepo

func (r *Repository) GetRepo(id string) (*GitRepo, error)

func (*Repository) GetRepos added in v1.0.2

func (r *Repository) GetRepos() *database.Collection[*GitRepo]

GetRepos returns the repos collection for direct access

func (*Repository) GetWorkspace

func (r *Repository) GetWorkspace(name string) (*Workspace, error)

func (*Repository) GitServer

func (repo *Repository) GitServer(auth *authentication.Controller) http.Handler

func (*Repository) NewAccessToken

func (r *Repository) NewAccessToken(expires time.Time) (*AccessToken, error)

func (*Repository) NewRepo

func (r *Repository) NewRepo(repoID, name string) (repo *GitRepo, err error)

func (*Repository) NewWorkspace

func (r *Repository) NewWorkspace(name string, port int, repo *GitRepo) (*Workspace, error)

func (*Repository) SearchRepos

func (r *Repository) SearchRepos(query string, args ...any) ([]*GitRepo, error)

func (*Repository) UpdateRepo added in v1.0.2

func (r *Repository) UpdateRepo(repo *GitRepo) error

UpdateRepo updates an existing repository

func (*Repository) Workspace

func (repo *Repository) Workspace(auth *authentication.Controller) http.Handler

func (*Repository) Workspaces

func (r *Repository) Workspaces() ([]*Workspace, error)

type Workspace

type Workspace struct {
	database.Model
	Name   string
	Port   int
	Ready  bool
	RepoID string
	// contains filtered or unexported fields
}

func (*Workspace) Repo

func (w *Workspace) Repo() (*GitRepo, error)

func (*Workspace) Run

func (w *Workspace) Run(cmd string) (stdout bytes.Buffer, err error)

func (*Workspace) Service

func (w *Workspace) Service() *containers.Service

func (*Workspace) Start

func (w *Workspace) Start(u *authentication.User) error

func (*Workspace) Table

func (*Workspace) Table() string

Jump to

Keyboard shortcuts

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