model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Package

type Package struct {
	Path      string // Import path
	Version   string // Version
	IsGitHub  bool   // Whether it's a GitHub repository
	IsStarred bool   // Whether it's starred by the user
	Size      int64  // Size in bytes
}

Package represents a Go module dependency

func NewPackage

func NewPackage(path, version string) *Package

NewPackage creates a new Package instance

func (*Package) FormattedSize

func (p *Package) FormattedSize() string

FormattedSize returns the size in a human-readable format

func (*Package) GitHubRepoPath

func (p *Package) GitHubRepoPath() string

GitHubRepoPath returns the GitHub repository path (owner/repo) Returns empty string if not a GitHub repository

func (*Package) GitHubURL

func (p *Package) GitHubURL() string

GitHubURL returns the GitHub repository URL Returns empty string if not a GitHub repository

func (*Package) PkgGoDevURL

func (p *Package) PkgGoDevURL() string

PkgGoDevURL returns the pkg.go.dev URL for the package

func (*Package) StarSymbol

func (p *Package) StarSymbol() string

StarSymbol returns the star symbol based on the starred status Returns empty string if not a GitHub repository

func (*Package) String

func (p *Package) String() string

String returns a string representation of the package

Jump to

Keyboard shortcuts

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