forgepb

package module
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: GPL-3.0 Imports: 20 Imported by: 0

README

protobuf definition files for forge

Documentation

Overview

Example

This example is copied from rill to understand golang docs

package main

import (
	"fmt"
)

func main() {
	fmt.Println("nothing here yet")
}
Output:

Example (Batching)

This example is copied from rill to understand golang docs

package main

import (
	"fmt"
)

func main() {
	fmt.Println("nothing batching here yet")
}
Output:

Index

Examples

Constants

This section is empty.

Variables

View Source
var FORGEPB *log.LogFlag
View Source
var FORGEPBWARN *log.LogFlag

Functions

func IsDirectory added in v0.0.8

func IsDirectory(path string) bool

func IsGitDir added in v0.0.7

func IsGitDir(dir string) bool

IsGitDir checks if a .git directory exists inside the given directory

func ReleaseReportHeader added in v0.0.16

func ReleaseReportHeader() string

Types

type Forge added in v0.0.7

type Forge struct {
	Config  *ForgeConfigs // config repos for readonly, private, etc
	Repos   *gitpb.Repos
	Machine *zoopb.Machine
	// contains filtered or unexported fields
}

maybe an interface someday?

func Init added in v0.0.7

func Init() *Forge

func (*Forge) Build added in v0.0.13

func (f *Forge) Build(repo *gitpb.Repo, userFlags []string) error

func (*Forge) CheckoutDevel added in v0.0.18

func (f *Forge) CheckoutDevel() bool

func (*Forge) CheckoutMaster added in v0.0.18

func (f *Forge) CheckoutMaster() bool

func (*Forge) CheckoutUser added in v0.0.18

func (f *Forge) CheckoutUser() bool

func (*Forge) Clone added in v0.0.8

func (f *Forge) Clone(gopath string) (*gitpb.Repo, error)

attempt to git clone if the go path doesn't exist does a git clone, if it works, returns true workdir = /home/jcarr/go/src/ gopath = go.wit.com/apps/helloworld

func (*Forge) ConfigPrintTable added in v0.0.7

func (f *Forge) ConfigPrintTable()

print a human readable table to STDOUT

func (*Forge) ConfigSave added in v0.0.7

func (f *Forge) ConfigSave() error

write to ~/.config/forge/ unless ENV{FORGE_HOME} is set

func (*Forge) DebName added in v0.0.7

func (f *Forge) DebName(gopath string) string

returns the deb package name this let's you check a git tag version against a package .deb version allows gopath's to not need to match the .deb name this is important in lots of cases! It is normal and happens often enough.

func (*Forge) FinalGoDepsCheckOk added in v0.0.16

func (f *Forge) FinalGoDepsCheckOk(check *gitpb.Repo) bool

this is a final check to make sure, before pushing a golang repo, that the go.sum file has the correct and current version of every package

it re-scans the go.sum file. DOES NOT MODIFY ANYTHING this is the last thing to run to double check everything before 'git tag' or git push --tags

func (*Forge) GetGoSrc added in v0.0.7

func (f *Forge) GetGoSrc() string

func (*Forge) GitPull added in v0.0.18

func (f *Forge) GitPull() bool

func (*Forge) Install added in v0.0.15

func (f *Forge) Install(repo *gitpb.Repo, userFlags []string) error

func (*Forge) IsFavorite added in v0.0.7

func (f *Forge) IsFavorite(thing string) bool

IsFavorite() -- fun option for the config file that lets you set things as favorites so you can just go-clone a bunch of common things on a new box or after you reset/delete your ~/go/src dir

func (*Forge) IsPrivate added in v0.0.7

func (f *Forge) IsPrivate(thing string) bool

is this a non-publishable repo? matches package names from apt

IsPrivate("foo") will match anything in the config file ending in "foo"

IsPrivate("go.foo.com/jcarr/foo") returns true if private IsPrivate("foo") also returns true if "go.bar.com/jcarr/foo" is private

func (*Forge) IsReadOnly added in v0.0.7

func (f *Forge) IsReadOnly(repo *gitpb.Repo) bool

returns true if gopath is readonly() will attempt to match IsWritable("foo") against anything ending in "foo"

func (*Forge) NewGoPathRepo added in v0.0.18

func (f *Forge) NewGoPathRepo(gopath string) (*gitpb.Repo, error)

func (*Forge) RillRedoGoMod added in v0.0.19

func (f *Forge) RillRedoGoMod() int

func (*Forge) ScanGoSrc added in v0.0.7

func (f *Forge) ScanGoSrc() (bool, error)

func (*Forge) StandardReleaseHeader added in v0.0.16

func (f *Forge) StandardReleaseHeader(repo *gitpb.Repo, state string) string

show information while doing golang releases

func (*Forge) VerifyBranchNames added in v0.0.13

func (f *Forge) VerifyBranchNames(newr *gitpb.Repo)

type Module added in v0.0.8

type Module struct {
	Path       string       // module path
	Query      string       // version query corresponding to this version
	Version    string       // module version
	Versions   []string     // available module versions
	Replace    *Module      // replaced by this module
	Time       *time.Time   // time version was created
	Update     *Module      // available update (with -u)
	Main       bool         // is this the main module?
	Indirect   bool         // module is only indirectly needed by main module
	Dir        string       // directory holding local copy of files, if any
	GoMod      string       // path to go.mod file describing module, if any
	GoVersion  string       // go version used in module
	Retracted  []string     // retraction information, if any (with -retracted or -u)
	Deprecated string       // deprecation message, if any (with -u)
	Error      *ModuleError // error loading module
	Sum        string       // checksum for path, version (as in go.sum)
	GoModSum   string       // checksum for go.mod (as in go.sum)
	Reuse      bool         // reuse of old module info is safe
	Origin     Origin
}

type ModuleError added in v0.0.8

type ModuleError struct {
	Err string // the error itself
}

type Origin added in v0.0.8

type Origin struct {
	VCS    string `json:",omitempty"` // "git" etc
	URL    string `json:",omitempty"` // URL of repository
	Subdir string `json:",omitempty"` // subdirectory in repo

	Hash string `json:",omitempty"` // commit hash or ID

	// If TagSum is non-empty, then the resolution of this module version
	// depends on the set of tags present in the repo, specifically the tags
	// of the form TagPrefix + a valid semver version.
	// If the matching repo tags and their commit hashes still hash to TagSum,
	// the Origin is still valid (at least as far as the tags are concerned).
	// The exact checksum is up to the Repo implementation; see (*gitRepo).Tags.
	TagPrefix string `json:",omitempty"`
	TagSum    string `json:",omitempty"`

	// If Ref is non-empty, then the resolution of this module version
	// depends on Ref resolving to the revision identified by Hash.
	// If Ref still resolves to Hash, the Origin is still valid (at least as far as Ref is concerned).
	// For Git, the Ref is a full ref like "refs/heads/main" or "refs/tags/v1.2.3",
	// and the Hash is the Git object hash the ref maps to.
	// Other VCS might choose differently, but the idea is that Ref is the name
	// with a mutable meaning while Hash is a name with an immutable meaning.
	Ref string `json:",omitempty"`

	// If RepoSum is non-empty, then the resolution of this module version
	// failed due to the repo being available but the version not being present.
	// This depends on the entire state of the repo, which RepoSum summarizes.
	// For Git, this is a hash of all the refs and their hashes.
	RepoSum string `json:",omitempty"`
}

An Origin describes the provenance of a given repo method result. It can be passed to CheckReuse (usually in a different go command invocation) to see whether the result remains up-to-date.

Jump to

Keyboard shortcuts

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