link

package
v0.44.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Resource

type Resource struct {
	url.URL
	Host  string
	Owner string
	Repo  string
	Type  string
	Ref   string
	Path  string
}

Resource represents a GitHub resource URL

func NewResource

func NewResource(URL string) (Resource, error)

NewResource creates new resource from url as string

func NewResourceFromURL

func NewResourceFromURL(u *url.URL) (Resource, error)

NewResourceFromURL creates new resource from url object

func (*Resource) ToRawURL

func (r *Resource) ToRawURL() (string, error)

ToRawURL returns the GitHub raw URL if the resource is 'blob', otherwise returns the origin URL

func (*Resource) ToResourceURL

func (r *Resource) ToResourceURL() (string, error)

ToResourceURL returns the u

func (*Resource) TotRepoURL

func (r *Resource) TotRepoURL() (string, error)

TotRepoURL returns the GitHub repository URL

Jump to

Keyboard shortcuts

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