forgepb

package module
v0.0.40 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: GPL-3.0 Imports: 19 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 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

func RunGitClone added in v0.0.39

func RunGitClone(newdir, basedir, giturl string) error

git clone (also downloads git notes) newdir = helloworld basedir = /home/jcarr/go/src/go.wit.com/apps giturl = https://gitea.wit.com/gui/helloworld

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

todo: use initOnce cache.go has Do() f.initOnce.Do(f.initWork)

func InitPB added in v0.0.29

func InitPB() *Forge

only init's the protobuf. intended to not scan or change anything

func (*Forge) AddFullPath added in v0.0.36

func (f *Forge) AddFullPath(fulldir string) *gitpb.Repo

func (*Forge) Build added in v0.0.13

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

func (*Forge) CheckOverride added in v0.0.28

func (f *Forge) CheckOverride(gopath string) bool

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) 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

func (*Forge) DeleteByGoPath added in v0.0.37

func (f *Forge) DeleteByGoPath(gopath string) bool

func (*Forge) Exit added in v0.0.37

func (f *Forge) Exit()

saves the config if there have been changes

func (*Forge) FinalGoDepsCheckOk added in v0.0.16

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

DOES NOT MODIFY ANYTHING

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) FindAnyPath added in v0.0.39

func (f *Forge) FindAnyPath(dir string) *gitpb.Repo

tries any parent

func (*Forge) FindByGoPath added in v0.0.37

func (f *Forge) FindByGoPath(gopath string) *gitpb.Repo

func (*Forge) FindWorkingDirRepo added in v0.0.35

func (f *Forge) FindWorkingDirRepo() *gitpb.Repo

sortcut to find

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) GoClone added in v0.0.39

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

will not violate filesystem namespace always returns the path or a parent path

attemps to exec git clone based off of a golang path will transferse parent directories in case the path is a child of a git repo

returns *gitpb.Repo if already cloned

example gopath = go.wit.com/apps/go-clone or "go.googlesource.com/go/src/cmd/internal/pkgpath/" returns repo for "go.googlesource.com/go"

func (*Forge) Install added in v0.0.15

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

func (*Forge) IsGoWork added in v0.0.27

func (f *Forge) IsGoWork() bool

func (*Forge) MakeDevelBranch added in v0.0.28

func (f *Forge) MakeDevelBranch(repo *gitpb.Repo) error

func (*Forge) MakeDevelPatchSet added in v0.0.28

func (f *Forge) MakeDevelPatchSet() (*Patchs, error)

func (*Forge) MakeGoWork added in v0.0.27

func (f *Forge) MakeGoWork() error

very much a hack job

func (*Forge) MakeMasterPatchSet added in v0.0.28

func (f *Forge) MakeMasterPatchSet() (*Patchs, error)

func (*Forge) MakePatchSet added in v0.0.28

func (f *Forge) MakePatchSet() (*Patchs, error)

func (*Forge) MakeUserBranch added in v0.0.28

func (f *Forge) MakeUserBranch(repo *gitpb.Repo) error

func (*Forge) NewGoRepo added in v0.0.37

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

func (*Forge) PrintReleaseReport added in v0.0.37

func (f *Forge) PrintReleaseReport(repos *gitpb.Repos) int

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) SendPatchSet added in v0.0.28

func (f *Forge) SendPatchSet(pset *Patchs) error

func (*Forge) SetConfigSave added in v0.0.37

func (f *Forge) SetConfigSave(b bool)

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) ValidGoVersion added in v0.0.36

func (f *Forge) ValidGoVersion(ver string) (bool, error)

golang versions MUST be vX.X.X it can not be vX.X and it also can not be v0.0.0 verifies the version is format v3.2.1

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