convert

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: ISC Imports: 19 Imported by: 0

Documentation

Overview

Package convert contains functions supporting the conversion of repository data into types used by the templates.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDirectoryNotFound = errors.New("directory not found")
	ErrFileNotFound      = errors.New("file not found")
)

Functions

func ToBlobData

func ToBlobData(repo *repo.Repo, req *request.Request) (data.BlobData, error)

func ToCommitData

func ToCommitData(repo *repo.Repo, req *request.Request) (data.CommitData, error)

func ToDiffData

func ToDiffData(repo *repo.Repo, req *request.Request) (data.DiffData, error)

func ToIndexData

func ToIndexData(repos []*repo.Repo) data.IndexData

func ToLogData

func ToLogData(repo *repo.Repo, req *request.Request) (data.LogData, error)

func ToRefsData

func ToRefsData(repo *repo.Repo) (data.RefsData, error)

func ToTreeData

func ToTreeData(repo *repo.Repo, req *request.Request) (data.TreeData, error)

Types

type ByAge

type ByAge []data.Reference

func (ByAge) Len

func (b ByAge) Len() int

func (ByAge) Less

func (b ByAge) Less(i, j int) bool

func (ByAge) Swap

func (b ByAge) Swap(i, j int)

type DumbCloneResponse

type DumbCloneResponse struct {
	ContentType string
	Data        *bytes.Buffer
}

func ToCloneData

func ToCloneData(repo *repo.Repo, r *request.Request, cfg config.Config) (*DumbCloneResponse, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳