sourcecollector

package
v0.0.0-...-5716371 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidRepositoryUrl = fmt.Errorf("invalid repository url format")
)

Functions

This section is empty.

Types

type Data

type Data struct {
	Folders []Folder `json:"folders"`
	Files   []File   `json:"files"`
}

type File

type File struct {
	Name string `json:"name"`
	Path string `json:"path"`
}

type Folder

type Folder struct {
	Name  string `json:"name"`
	Path  string `json:"path"`
	Files []File `json:"files"`
}

type Metadata

type Metadata struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Topics      []string `json:"topics"`
	Stars       int      `json:"stars"`
	Size        int      `json:"size"`
}

type RemoteRepository

type RemoteRepository struct {
	Owner      string `json:"owner"`
	Repository string `json:"repository"`
	Token      string `json:"token"`
	Url        string `json:"url"`
}

func (*RemoteRepository) GetMetadata

func (rr *RemoteRepository) GetMetadata() (Metadata, error)

func (*RemoteRepository) SaveTextFile

func (rr *RemoteRepository) SaveTextFile(path string) error

type Repository

type Repository interface {
	GetMetadata() (Metadata, error)
	SaveTextFile(string) error
}

func NewRepository

func NewRepository(url string) (Repository, error)

Jump to

Keyboard shortcuts

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