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 ¶
- Variables
- func IsDirectory(path string) bool
- func IsGitDir(dir string) bool
- func ReleaseReportHeader() string
- type Forge
- func (f *Forge) Build(repo *gitpb.Repo, userFlags []string) error
- func (f *Forge) CheckoutDevel() bool
- func (f *Forge) CheckoutMaster() bool
- func (f *Forge) CheckoutUser() bool
- func (f *Forge) Clone(gopath string) (*gitpb.Repo, error)
- func (f *Forge) ConfigPrintTable()
- func (f *Forge) ConfigSave() error
- func (f *Forge) DebName(gopath string) string
- func (f *Forge) FinalGoDepsCheckOk(check *gitpb.Repo) bool
- func (f *Forge) GetGoSrc() string
- func (f *Forge) GitPull() bool
- func (f *Forge) Install(repo *gitpb.Repo, userFlags []string) error
- func (f *Forge) IsFavorite(thing string) bool
- func (f *Forge) IsPrivate(thing string) bool
- func (f *Forge) IsReadOnly(gopath string) bool
- func (f *Forge) NewGoPathRepo(gopath string) (*gitpb.Repo, error)
- func (f *Forge) ScanGoSrc() (bool, error)
- func (f *Forge) StandardReleaseHeader(repo *gitpb.Repo, state string) string
- func (f *Forge) VerifyBranchNames(newr *gitpb.Repo)
- type ForgeConfig
- func (*ForgeConfig) Descriptor() ([]byte, []int)deprecated
- func (x *ForgeConfig) GetDebName() string
- func (x *ForgeConfig) GetDevelBranchName() string
- func (x *ForgeConfig) GetDirectory() bool
- func (x *ForgeConfig) GetFavorite() bool
- func (x *ForgeConfig) GetGoPath() string
- func (x *ForgeConfig) GetInteresting() bool
- func (x *ForgeConfig) GetMasterBranchName() string
- func (x *ForgeConfig) GetPrivate() bool
- func (x *ForgeConfig) GetReadOnly() bool
- func (x *ForgeConfig) GetUserBranchName() string
- func (x *ForgeConfig) GetVerstamp() *timestamppb.Timestamp
- func (x *ForgeConfig) GetWritable() bool
- func (*ForgeConfig) ProtoMessage()
- func (x *ForgeConfig) ProtoReflect() protoreflect.Message
- func (x *ForgeConfig) Reset()
- func (x *ForgeConfig) String() string
- type ForgeConfigGoPath
- type ForgeConfigIterator
- type ForgeConfigs
- func (all *ForgeConfigs) All() *ForgeConfigIterator
- func (all *ForgeConfigs) Append(newP *ForgeConfig) bool
- func (all *ForgeConfigs) AppendUniqueGoPath(newP *ForgeConfig) bool
- func (c *ForgeConfigs) ConfigLoad() error
- func (all *ForgeConfigs) DeleteByGoPath(s string) bool
- func (*ForgeConfigs) Descriptor() ([]byte, []int)deprecated
- func (all *ForgeConfigs) FindByGoPath(s string) *ForgeConfig
- func (v *ForgeConfigs) FormatJSON() string
- func (v *ForgeConfigs) FormatTEXT() string
- func (x *ForgeConfigs) GetForgeConfigs() []*ForgeConfig
- func (x *ForgeConfigs) GetUuid() string
- func (x *ForgeConfigs) GetVersion() string
- func (all *ForgeConfigs) Len() int
- func (v *ForgeConfigs) Marshal() ([]byte, error)
- func (v *ForgeConfigs) MarshalJSON() ([]byte, error)
- func (*ForgeConfigs) ProtoMessage()
- func (x *ForgeConfigs) ProtoReflect() protoreflect.Message
- func (all *ForgeConfigs) ReplaceGoPath(newP *ForgeConfig) bool
- func (x *ForgeConfigs) Reset()
- func (all *ForgeConfigs) SortByGoPath() *ForgeConfigIterator
- func (x *ForgeConfigs) String() string
- func (v *ForgeConfigs) Unmarshal(data []byte) error
- func (v *ForgeConfigs) UnmarshalJSON(data []byte) error
- func (v *ForgeConfigs) UnmarshalTEXT(data []byte) error
- type Module
- type ModuleError
- type Origin
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var FORGEPB *log.LogFlag
var FORGEPBWARN *log.LogFlag
var File_forgeConfig_proto protoreflect.FileDescriptor
Functions ¶
func IsDirectory ¶ added in v0.0.8
func IsGitDir ¶ added in v0.0.7
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 (*Forge) CheckoutDevel ¶ added in v0.0.18
func (*Forge) CheckoutMaster ¶ added in v0.0.18
func (*Forge) CheckoutUser ¶ added in v0.0.18
func (*Forge) Clone ¶ added in v0.0.8
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
write to ~/.config/forge/ unless ENV{FORGE_HOME} is set
func (*Forge) DebName ¶ added in v0.0.7
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
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) IsFavorite ¶ added in v0.0.7
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
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
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 (*Forge) StandardReleaseHeader ¶ added in v0.0.16
show information while doing golang releases
func (*Forge) VerifyBranchNames ¶ added in v0.0.13
type ForgeConfig ¶ added in v0.0.7
type ForgeConfig struct { GoPath string `protobuf:"bytes,1,opt,name=goPath,proto3" json:"goPath,omitempty"` // `autogenpb:unique` // Examples: 'go.wit.com/apps/go-clone' or "~/mythings" or "/home/src/foo" Writable bool `protobuf:"varint,2,opt,name=writable,proto3" json:"writable,omitempty"` // if you have write access to the repo ReadOnly bool `protobuf:"varint,3,opt,name=readOnly,proto3" json:"readOnly,omitempty"` // the opposite, but needed for now because I don't know what I'm doing Private bool `protobuf:"varint,4,opt,name=private,proto3" json:"private,omitempty"` // if the repo can be published Directory bool `protobuf:"varint,5,opt,name=directory,proto3" json:"directory,omitempty"` // everything in this directory should use these writable & private values Favorite bool `protobuf:"varint,6,opt,name=favorite,proto3" json:"favorite,omitempty"` // you like this. always git clone/go clone this repo Interesting bool `protobuf:"varint,7,opt,name=interesting,proto3" json:"interesting,omitempty"` // this is something interesting you found and want to remember it MasterBranchName string `protobuf:"bytes,8,opt,name=masterBranchName,proto3" json:"masterBranchName,omitempty"` // git 'main' or 'master' branch name DevelBranchName string `protobuf:"bytes,9,opt,name=develBranchName,proto3" json:"develBranchName,omitempty"` // whatever the git 'devel' branch name is UserBranchName string `protobuf:"bytes,10,opt,name=userBranchName,proto3" json:"userBranchName,omitempty"` // whatever your username branch is DebName string `protobuf:"bytes,11,opt,name=debName,proto3" json:"debName,omitempty"` // the actual name used with 'apt install' (or distro apt equivalent. Verstamp *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=verstamp,proto3" json:"verstamp,omitempty"` // the git commit timestamp of the version // contains filtered or unexported fields }
define 3 branches. that is all that is supported the term 'master' is used in the code because 'main' is a reserved word in golang already allow 'read only' and 'private' flags package names sometimes must be different than the binary name for example 'zookeeper' is packaged as 'zookeeper-go'
due to the prior apache foundation project. This happens and is ok!
func (*ForgeConfig) Descriptor
deprecated
added in
v0.0.7
func (*ForgeConfig) Descriptor() ([]byte, []int)
Deprecated: Use ForgeConfig.ProtoReflect.Descriptor instead.
func (*ForgeConfig) GetDebName ¶ added in v0.0.7
func (x *ForgeConfig) GetDebName() string
func (*ForgeConfig) GetDevelBranchName ¶ added in v0.0.7
func (x *ForgeConfig) GetDevelBranchName() string
func (*ForgeConfig) GetDirectory ¶ added in v0.0.7
func (x *ForgeConfig) GetDirectory() bool
func (*ForgeConfig) GetFavorite ¶ added in v0.0.7
func (x *ForgeConfig) GetFavorite() bool
func (*ForgeConfig) GetGoPath ¶ added in v0.0.7
func (x *ForgeConfig) GetGoPath() string
func (*ForgeConfig) GetInteresting ¶ added in v0.0.7
func (x *ForgeConfig) GetInteresting() bool
func (*ForgeConfig) GetMasterBranchName ¶ added in v0.0.7
func (x *ForgeConfig) GetMasterBranchName() string
func (*ForgeConfig) GetPrivate ¶ added in v0.0.7
func (x *ForgeConfig) GetPrivate() bool
func (*ForgeConfig) GetReadOnly ¶ added in v0.0.7
func (x *ForgeConfig) GetReadOnly() bool
func (*ForgeConfig) GetUserBranchName ¶ added in v0.0.7
func (x *ForgeConfig) GetUserBranchName() string
func (*ForgeConfig) GetVerstamp ¶ added in v0.0.7
func (x *ForgeConfig) GetVerstamp() *timestamppb.Timestamp
func (*ForgeConfig) GetWritable ¶ added in v0.0.7
func (x *ForgeConfig) GetWritable() bool
func (*ForgeConfig) ProtoMessage ¶ added in v0.0.7
func (*ForgeConfig) ProtoMessage()
func (*ForgeConfig) ProtoReflect ¶ added in v0.0.7
func (x *ForgeConfig) ProtoReflect() protoreflect.Message
func (*ForgeConfig) Reset ¶ added in v0.0.7
func (x *ForgeConfig) Reset()
func (*ForgeConfig) String ¶ added in v0.0.7
func (x *ForgeConfig) String() string
type ForgeConfigGoPath ¶ added in v0.0.11
type ForgeConfigGoPath []*ForgeConfig
func (ForgeConfigGoPath) Len ¶ added in v0.0.11
func (a ForgeConfigGoPath) Len() int
func (ForgeConfigGoPath) Less ¶ added in v0.0.11
func (a ForgeConfigGoPath) Less(i, j int) bool
func (ForgeConfigGoPath) Swap ¶ added in v0.0.11
func (a ForgeConfigGoPath) Swap(i, j int)
type ForgeConfigIterator ¶ added in v0.0.7
func NewForgeConfigIterator ¶ added in v0.0.7
func NewForgeConfigIterator(packs []*ForgeConfig) *ForgeConfigIterator
NewForgeConfigIterator initializes a new iterator.
func (*ForgeConfigIterator) Next ¶ added in v0.0.7
func (it *ForgeConfigIterator) Next() *ForgeConfig
Next() returns the next thing in the array
func (*ForgeConfigIterator) Scan ¶ added in v0.0.7
func (it *ForgeConfigIterator) Scan() bool
Scan moves to the next element and returns false if there are no more packs. Use Scan() in a loop, similar to a while loop
for iterator.Scan() d := iterator.Next( fmt.Println("found UUID:", d.Uuid }
type ForgeConfigs ¶ added in v0.0.7
type ForgeConfigs struct { Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // could be useful for /usr/share/file/magic someday? Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // could be used for protobuf schema change violations? ForgeConfigs []*ForgeConfig `protobuf:"bytes,3,rep,name=ForgeConfigs,proto3" json:"ForgeConfigs,omitempty"` // contains filtered or unexported fields }
TODO: autogen 'sort', 'marshal'
func (*ForgeConfigs) All ¶ added in v0.0.7
func (all *ForgeConfigs) All() *ForgeConfigIterator
func (*ForgeConfigs) Append ¶ added in v0.0.7
func (all *ForgeConfigs) Append(newP *ForgeConfig) bool
does not enforce any unique fields
func (*ForgeConfigs) AppendUniqueGoPath ¶ added in v0.0.7
func (all *ForgeConfigs) AppendUniqueGoPath(newP *ForgeConfig) bool
enforces GoPath is unique
func (*ForgeConfigs) ConfigLoad ¶ added in v0.0.7
func (c *ForgeConfigs) ConfigLoad() error
load the ~/.config/forge/ files
func (*ForgeConfigs) DeleteByGoPath ¶ added in v0.0.7
func (all *ForgeConfigs) DeleteByGoPath(s string) bool
func (*ForgeConfigs) Descriptor
deprecated
added in
v0.0.7
func (*ForgeConfigs) Descriptor() ([]byte, []int)
Deprecated: Use ForgeConfigs.ProtoReflect.Descriptor instead.
func (*ForgeConfigs) FindByGoPath ¶ added in v0.0.7
func (all *ForgeConfigs) FindByGoPath(s string) *ForgeConfig
find a dependancy by the go path
func (*ForgeConfigs) FormatJSON ¶ added in v0.0.7
func (v *ForgeConfigs) FormatJSON() string
human readable JSON
func (*ForgeConfigs) FormatTEXT ¶ added in v0.0.7
func (v *ForgeConfigs) FormatTEXT() string
apparently this isn't stable, but it's awesomely better https://protobuf.dev/reference/go/faq/#unstable-text it's so great for config files, I'm using it by default to try to fix the problems with it
func (*ForgeConfigs) GetForgeConfigs ¶ added in v0.0.7
func (x *ForgeConfigs) GetForgeConfigs() []*ForgeConfig
func (*ForgeConfigs) GetUuid ¶ added in v0.0.7
func (x *ForgeConfigs) GetUuid() string
func (*ForgeConfigs) GetVersion ¶ added in v0.0.7
func (x *ForgeConfigs) GetVersion() string
func (*ForgeConfigs) Len ¶ added in v0.0.7
func (all *ForgeConfigs) Len() int
func (*ForgeConfigs) Marshal ¶ added in v0.0.7
func (v *ForgeConfigs) Marshal() ([]byte, error)
marshal to wire. This is called winning.
func (*ForgeConfigs) MarshalJSON ¶ added in v0.0.7
func (v *ForgeConfigs) MarshalJSON() ([]byte, error)
marshal json
func (*ForgeConfigs) ProtoMessage ¶ added in v0.0.7
func (*ForgeConfigs) ProtoMessage()
func (*ForgeConfigs) ProtoReflect ¶ added in v0.0.7
func (x *ForgeConfigs) ProtoReflect() protoreflect.Message
func (*ForgeConfigs) ReplaceGoPath ¶ added in v0.0.7
func (all *ForgeConfigs) ReplaceGoPath(newP *ForgeConfig) bool
enforces GoPath is unique
func (*ForgeConfigs) Reset ¶ added in v0.0.7
func (x *ForgeConfigs) Reset()
func (*ForgeConfigs) SortByGoPath ¶ added in v0.0.11
func (all *ForgeConfigs) SortByGoPath() *ForgeConfigIterator
func (*ForgeConfigs) String ¶ added in v0.0.7
func (x *ForgeConfigs) String() string
func (*ForgeConfigs) Unmarshal ¶ added in v0.0.7
func (v *ForgeConfigs) Unmarshal(data []byte) error
unmarshal from wire. You have won.
func (*ForgeConfigs) UnmarshalJSON ¶ added in v0.0.7
func (v *ForgeConfigs) UnmarshalJSON(data []byte) error
unmarshal json
func (*ForgeConfigs) UnmarshalTEXT ¶ added in v0.0.7
func (v *ForgeConfigs) UnmarshalTEXT(data []byte) error
unmarshalTEXT. This reads the .text config file back in after the user edits it
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.