ghpath

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasBranchPrefix

func HasBranchPrefix(s string) bool

func HasReleasePrefix

func HasReleasePrefix(s string) bool

Types

type AssetPath

type AssetPath struct {
	ReleasePath
	Asset string
}

func NewAssetPath

func NewAssetPath(owner, repo, release, asset string) AssetPath

func ParseAsset

func ParseAsset(path Path) (asset AssetPath, err error)

func (AssetPath) Parse

func (p AssetPath) Parse(path string) (Path, error)

func (AssetPath) String

func (p AssetPath) String() string

type BranchPath

type BranchPath struct {
	RepositoryPath
	Branch string
}

func NewBranchPath

func NewBranchPath(owner, repo, branch string) BranchPath

func ParseBranch

func ParseBranch(path Path) (branch BranchPath, err error)

func (BranchPath) Parse

func (p BranchPath) Parse(path string) (Path, error)

func (BranchPath) String

func (p BranchPath) String() string

type ContentPath

type ContentPath struct {
	BranchPath
	Content string
}

func NewContentPath

func NewContentPath(owner, repo, branch, content string) ContentPath

func ParseContent

func ParseContent(p Path) (content ContentPath, err error)

func (ContentPath) Parse

func (p ContentPath) Parse(path string) (Path, error)

func (ContentPath) String

func (p ContentPath) String() string

type OwnerPath

type OwnerPath struct {
	Owner string
}

func NewOwnerPath

func NewOwnerPath(owner string) OwnerPath

func ParseOwner

func ParseOwner(path Path) (owner OwnerPath, err error)

func (OwnerPath) Parse

func (p OwnerPath) Parse(path string) (Path, error)

func (OwnerPath) String

func (p OwnerPath) String() string

type Parser

type Parser interface {
	Parse(string) (Path, error)
}

type Path

type Path interface {
	fmt.Stringer
	Asset() (string, error)
	Branch() (string, error)
	Content() []string
	Owner() (string, error)
	Repository() (string, error)
	Release() (string, error)
}

func Parse

func Parse(parts ...string) (Path, error)

func ParseUrl

func ParseUrl(rawURL string) (Path, error)

type ReleasePath

type ReleasePath struct {
	RepositoryPath
	Release string
}

func NewReleasePath

func NewReleasePath(owner, repo, release string) ReleasePath

func ParseRelease

func ParseRelease(path Path) (release ReleasePath, err error)

func (ReleasePath) Parse

func (p ReleasePath) Parse(path string) (Path, error)

func (ReleasePath) String

func (p ReleasePath) String() string

type RepositoryPath

type RepositoryPath struct {
	OwnerPath
	Repository string
}

func NewRepositoryPath

func NewRepositoryPath(owner, repo string) RepositoryPath

func ParseRepository

func ParseRepository(path Path) (repo RepositoryPath, err error)

func (RepositoryPath) Parse

func (p RepositoryPath) Parse(path string) (Path, error)

func (RepositoryPath) String

func (p RepositoryPath) String() string

Jump to

Keyboard shortcuts

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