forgepb

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: GPL-3.0 Imports: 18 Imported by: 26

README

protobuf definition files for forge

Documentation

Index

Constants

This section is empty.

Variables

Functions

func RepoHeader added in v0.0.2

func RepoHeader() string

Types

type ByRepoPath added in v0.0.2

type ByRepoPath []*Repo

func (ByRepoPath) Len added in v0.0.2

func (a ByRepoPath) Len() int

func (ByRepoPath) Less added in v0.0.2

func (a ByRepoPath) Less(i, j int) bool

func (ByRepoPath) Swap added in v0.0.2

func (a ByRepoPath) Swap(i, j int)

type Repo added in v0.0.2

type Repo struct {
	GoPath       string                 `protobuf:"bytes,1,opt,name=goPath,proto3" json:"goPath,omitempty"`             // 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
	MasterBranch string                 `protobuf:"bytes,8,opt,name=masterBranch,proto3" json:"masterBranch,omitempty"` // git 'main' or 'master' branch name
	DevelBranch  string                 `protobuf:"bytes,9,opt,name=develBranch,proto3" json:"develBranch,omitempty"`   // whatever the git 'devel' branch name is
	UserBranch   string                 `protobuf:"bytes,10,opt,name=userBranch,proto3" json:"userBranch,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 (*Repo) Age added in v0.0.2

func (r *Repo) Age(newP *Repo) time.Duration

returns time.Duration since last Update()

func (*Repo) Descriptor deprecated added in v0.0.2

func (*Repo) Descriptor() ([]byte, []int)

Deprecated: Use Repo.ProtoReflect.Descriptor instead.

func (*Repo) GetDebName added in v0.0.4

func (x *Repo) GetDebName() string

func (*Repo) GetDevelBranch added in v0.0.2

func (x *Repo) GetDevelBranch() string

func (*Repo) GetDirectory added in v0.0.2

func (x *Repo) GetDirectory() bool

func (*Repo) GetFavorite added in v0.0.2

func (x *Repo) GetFavorite() bool

func (*Repo) GetGoPath added in v0.0.2

func (x *Repo) GetGoPath() string

func (*Repo) GetInteresting added in v0.0.2

func (x *Repo) GetInteresting() bool

func (*Repo) GetMasterBranch added in v0.0.2

func (x *Repo) GetMasterBranch() string

func (*Repo) GetPrivate added in v0.0.2

func (x *Repo) GetPrivate() bool

func (*Repo) GetReadOnly added in v0.0.2

func (x *Repo) GetReadOnly() bool

func (*Repo) GetUserBranch added in v0.0.2

func (x *Repo) GetUserBranch() string

func (*Repo) GetVerstamp added in v0.0.2

func (x *Repo) GetVerstamp() *timestamppb.Timestamp

func (*Repo) GetWritable added in v0.0.2

func (x *Repo) GetWritable() bool

func (*Repo) Marshal added in v0.0.2

func (m *Repo) Marshal() ([]byte, error)

marshal to wire

func (*Repo) ProtoMessage added in v0.0.2

func (*Repo) ProtoMessage()

func (*Repo) ProtoReflect added in v0.0.2

func (x *Repo) ProtoReflect() protoreflect.Message

func (*Repo) Reset added in v0.0.2

func (x *Repo) Reset()

func (*Repo) String added in v0.0.2

func (x *Repo) String() string

func (*Repo) Unmarshal added in v0.0.2

func (m *Repo) Unmarshal(data []byte) error

unmarshal from wire

type RepoIterator

type RepoIterator struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewRepoIterator

func NewRepoIterator(packs []*Repo) *RepoIterator

NewRepoIterator initializes a new iterator.

func (*RepoIterator) Repo

func (it *RepoIterator) Repo() *Repo

Repo returns the current repo.

func (*RepoIterator) Scan

func (it *RepoIterator) Scan() bool

Scan moves to the next element and returns false if there are no more packs.

type Repos added in v0.0.2

type Repos 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?
	Repos   []*Repo `protobuf:"bytes,3,rep,name=repos,proto3" json:"repos,omitempty"`
	// contains filtered or unexported fields
}

TODO: autogen 'Repos'

func (*Repos) All added in v0.0.2

func (r *Repos) All() *RepoIterator

func (*Repos) Append added in v0.0.2

func (r *Repos) Append(newP *Repo) bool

enforces no duplicate repo paths

func (*Repos) ConfigLoad added in v0.0.2

func (c *Repos) ConfigLoad() error

load the ~/.config/forge/ files

func (*Repos) ConfigSave added in v0.0.2

func (m *Repos) ConfigSave() error

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

func (*Repos) DebName added in v0.0.4

func (all *Repos) 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 (*Repos) DeleteByPath added in v0.0.2

func (all *Repos) DeleteByPath(gopath string) *Repo

func (*Repos) Descriptor deprecated added in v0.0.2

func (*Repos) Descriptor() ([]byte, []int)

Deprecated: Use Repos.ProtoReflect.Descriptor instead.

func (*Repos) FindByPath added in v0.0.2

func (r *Repos) FindByPath(gopath string) *Repo

find a repo by path

func (*Repos) FormatJSON added in v0.0.2

func (p *Repos) FormatJSON() string

human readable JSON

func (*Repos) FormatTEXT added in v0.0.2

func (p *Repos) FormatTEXT() string

apparently this isn't supposed to be used? https://protobuf.dev/reference/go/faq/#unstable-text this is a shame because this is much nicer output than JSON Format() TODO: fix things so this is the default

func (*Repos) GetRepos added in v0.0.2

func (x *Repos) GetRepos() []*Repo

func (*Repos) GetUuid added in v0.0.2

func (x *Repos) GetUuid() string

func (*Repos) GetVersion added in v0.0.2

func (x *Repos) GetVersion() string

func (*Repos) IsPrivate added in v0.0.2

func (all *Repos) 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 (*Repos) IsReadOnly added in v0.0.2

func (all *Repos) IsReadOnly(gopath string) bool

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

func (*Repos) Len added in v0.0.2

func (r *Repos) Len() int

func (*Repos) Marshal added in v0.0.2

func (m *Repos) Marshal() ([]byte, error)

marshal to wire

func (*Repos) MarshalJSON added in v0.0.2

func (p *Repos) MarshalJSON() ([]byte, error)

marshal json

func (*Repos) PrintTable added in v0.0.3

func (all *Repos) PrintTable()

print a human readable table to STDOUT

func (*Repos) ProtoMessage added in v0.0.2

func (*Repos) ProtoMessage()

func (*Repos) ProtoReflect added in v0.0.2

func (x *Repos) ProtoReflect() protoreflect.Message

func (*Repos) Reset added in v0.0.2

func (x *Repos) Reset()

func (*Repos) SampleConfig added in v0.0.2

func (all *Repos) SampleConfig()

func (*Repos) SortByPath added in v0.0.2

func (r *Repos) SortByPath() *RepoIterator

func (*Repos) String added in v0.0.2

func (x *Repos) String() string

func (*Repos) Unmarshal added in v0.0.2

func (m *Repos) Unmarshal(data []byte) error

unmarshal from wire

func (*Repos) UnmarshalJSON added in v0.0.2

func (p *Repos) UnmarshalJSON(data []byte) error

unmarshal

func (*Repos) UnmarshalTEXT added in v0.0.2

func (p *Repos) UnmarshalTEXT(data []byte) error

unmarshalTEXT

func (*Repos) UpdateGoPath added in v0.0.2

func (all *Repos) UpdateGoPath(name string, gopath string) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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