zoopb

package module
v0.0.8 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: 19 Imported by: 8

README

protobuf definition files for zookeeper

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BUILDTIME string
View Source
var File_machine_proto protoreflect.FileDescriptor
View Source
var File_package_proto protoreflect.FileDescriptor
View Source
var VERSION string

sent via -ldflags

Functions

func ConfigSaveRaw added in v0.0.6

func ConfigSaveRaw(data []byte) error

Types

type ByMachineName added in v0.0.3

type ByMachineName []*Machine

func (ByMachineName) Len added in v0.0.3

func (a ByMachineName) Len() int

func (ByMachineName) Less added in v0.0.3

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

func (ByMachineName) Swap added in v0.0.3

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

type ByName added in v0.0.3

type ByName []*Package

func (ByName) Len added in v0.0.3

func (a ByName) Len() int

func (ByName) Less added in v0.0.3

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

func (ByName) Swap added in v0.0.3

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

type Machine added in v0.0.4

type Machine struct {
	Hostname  string                 `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"`
	Memory    int64                  `protobuf:"varint,2,opt,name=memory,proto3" json:"memory,omitempty"`
	Cpus      int64                  `protobuf:"varint,3,opt,name=cpus,proto3" json:"cpus,omitempty"`
	Distro    string                 `protobuf:"bytes,4,opt,name=distro,proto3" json:"distro,omitempty"`
	Packages  *Packages              `protobuf:"bytes,5,opt,name=packages,proto3" json:"packages,omitempty"`
	Laststamp *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=laststamp,proto3" json:"laststamp,omitempty"` // the last time we heard anything from this machine
	Installed *Packages              `protobuf:"bytes,7,opt,name=installed,proto3" json:"installed,omitempty"` // packages that are installed
	Available *Packages              `protobuf:"bytes,8,opt,name=available,proto3" json:"available,omitempty"` // packages that are available
	Wit       *Packages              `protobuf:"bytes,9,opt,name=wit,proto3" json:"wit,omitempty"`             // packages that are available from mirrors.wit.com
	// contains filtered or unexported fields
}

func (*Machine) Age added in v0.0.4

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

returns time.Duration since last Update()

func (*Machine) ConfigLoad added in v0.0.7

func (m *Machine) ConfigLoad() error

func (*Machine) ConfigSave added in v0.0.7

func (m *Machine) ConfigSave() error

when running on a single machine, save the file in forge/ as <hostname>.pb write to ~/.config/forge/ unless ENV{FORGE_HOME} is set

func (*Machine) Descriptor deprecated added in v0.0.4

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

Deprecated: Use Machine.ProtoReflect.Descriptor instead.

func (*Machine) FindInstalledByName added in v0.0.8

func (m *Machine) FindInstalledByName(name string) *Package

func (*Machine) FindPackageByName added in v0.0.5

func (m *Machine) FindPackageByName(name string) *Package

find a package by name

func (*Machine) FindVersion added in v0.0.8

func (m *Machine) FindVersion(name string, version string) *Package

looks to see if any package matches a name and version if version == "", return the first name found

func (*Machine) GetAvailable added in v0.0.7

func (x *Machine) GetAvailable() *Packages

func (*Machine) GetCpus added in v0.0.4

func (x *Machine) GetCpus() int64

func (*Machine) GetDistro added in v0.0.4

func (x *Machine) GetDistro() string

func (*Machine) GetHostname added in v0.0.4

func (x *Machine) GetHostname() string

func (*Machine) GetInstalled added in v0.0.7

func (x *Machine) GetInstalled() *Packages

func (*Machine) GetLaststamp added in v0.0.4

func (x *Machine) GetLaststamp() *timestamppb.Timestamp

func (*Machine) GetMemory added in v0.0.4

func (x *Machine) GetMemory() int64

func (*Machine) GetPackages added in v0.0.4

func (x *Machine) GetPackages() *Packages

func (*Machine) GetWit added in v0.0.7

func (x *Machine) GetWit() *Packages

func (*Machine) InitWit added in v0.0.8

func (m *Machine) InitWit() error

read the package list file from mirrors.wit.com

func (*Machine) IsInstalled added in v0.0.8

func (m *Machine) IsInstalled(name string) bool

func (*Machine) Marshal added in v0.0.4

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

marshal to wire

func (*Machine) MarshalJSON added in v0.0.7

func (m *Machine) MarshalJSON() ([]byte, error)

marshal to JSON

func (*Machine) MarshalTEXT added in v0.0.7

func (m *Machine) MarshalTEXT() ([]byte, error)

marshal to TEXT

func (*Machine) ProtoMessage added in v0.0.4

func (*Machine) ProtoMessage()

func (*Machine) ProtoReflect added in v0.0.4

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

func (*Machine) Reset added in v0.0.4

func (x *Machine) Reset()

func (*Machine) String added in v0.0.4

func (x *Machine) String() string

func (*Machine) Unmarshal added in v0.0.4

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

unmarshal from wire

func (*Machine) UpdatePackages added in v0.0.7

func (me *Machine) UpdatePackages() string

type MachineIterator added in v0.0.3

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

func NewMachineIterator added in v0.0.3

func NewMachineIterator(packs []*Machine) *MachineIterator

NewMachineIterator initializes a new iterator.

func (*MachineIterator) Machine added in v0.0.3

func (it *MachineIterator) Machine() *Machine

Machine returns the current repo.

func (*MachineIterator) Scan added in v0.0.3

func (it *MachineIterator) Scan() bool

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

type Machines added in v0.0.4

type Machines struct {
	Uuid     string     `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`       // I guess why not just have this on each file
	Version  string     `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // maybe can be used for protobuf schema change violations
	Machines []*Machine `protobuf:"bytes,3,rep,name=machines,proto3" json:"machines,omitempty"`
	// contains filtered or unexported fields
}

func (*Machines) All added in v0.0.4

func (r *Machines) All() *MachineIterator

func (*Machines) Append added in v0.0.4

func (r *Machines) Append(newP *Machine) bool

enforces no duplicate package names

func (*Machines) ConfigLoad added in v0.0.6

func (m *Machines) ConfigLoad() error

func (*Machines) ConfigSave added in v0.0.6

func (m *Machines) ConfigSave() error

writes out the cluster information it seperate files to make it humanly possible to hand edit things as needed

func (*Machines) Descriptor deprecated added in v0.0.4

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

Deprecated: Use Machines.ProtoReflect.Descriptor instead.

func (*Machines) FindByName added in v0.0.4

func (r *Machines) FindByName(name string) *Machine

find a machine by name

func (*Machines) GetMachines added in v0.0.4

func (x *Machines) GetMachines() []*Machine

func (*Machines) GetUuid added in v0.0.4

func (x *Machines) GetUuid() string

func (*Machines) GetVersion added in v0.0.4

func (x *Machines) GetVersion() string

func (*Machines) Len added in v0.0.4

func (r *Machines) Len() int

func (*Machines) Marshal added in v0.0.6

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

marshal to wire

func (*Machines) ProtoMessage added in v0.0.4

func (*Machines) ProtoMessage()

func (*Machines) ProtoReflect added in v0.0.4

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

func (*Machines) Reset added in v0.0.4

func (x *Machines) Reset()

func (*Machines) SortByName added in v0.0.4

func (r *Machines) SortByName() *MachineIterator

func (*Machines) String added in v0.0.4

func (x *Machines) String() string

func (*Machines) Unmarshal added in v0.0.6

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

unmarshal from wire

type Package added in v0.0.4

type Package struct {
	Name      string                 `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`            // name: zookeeper-go
	Version   string                 `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`      // version: 0.0.3
	Laststamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=laststamp,proto3" json:"laststamp,omitempty"`  // the last time this package was seen (used to timeout entries)
	SrcPath   string                 `protobuf:"bytes,4,opt,name=srcPath,proto3" json:"srcPath,omitempty"`      // path to the sources (go.wit.com/apps/zookeeper)
	Installed bool                   `protobuf:"varint,5,opt,name=installed,proto3" json:"installed,omitempty"` // if installed on your machine, this should be set to true
	PkgName   string                 `protobuf:"bytes,6,opt,name=pkgName,proto3" json:"pkgName,omitempty"`      // the apt filename pool/main/f/foo/foo_2.2.2_riscv64.deb
	// contains filtered or unexported fields
}

func (*Package) Age added in v0.0.4

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

returns time.Duration since last Update()

func (*Package) Descriptor deprecated added in v0.0.4

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

Deprecated: Use Package.ProtoReflect.Descriptor instead.

func (*Package) GetInstalled added in v0.0.7

func (x *Package) GetInstalled() bool

func (*Package) GetLaststamp added in v0.0.4

func (x *Package) GetLaststamp() *timestamppb.Timestamp

func (*Package) GetName added in v0.0.4

func (x *Package) GetName() string

func (*Package) GetPkgName added in v0.0.8

func (x *Package) GetPkgName() string

func (*Package) GetSrcPath added in v0.0.7

func (x *Package) GetSrcPath() string

func (*Package) GetVersion added in v0.0.4

func (x *Package) GetVersion() string

func (*Package) ProtoMessage added in v0.0.4

func (*Package) ProtoMessage()

func (*Package) ProtoReflect added in v0.0.4

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

func (*Package) Reset added in v0.0.4

func (x *Package) Reset()

func (*Package) String added in v0.0.4

func (x *Package) String() string

type PackageIterator added in v0.0.3

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

func NewPackageIterator added in v0.0.3

func NewPackageIterator(packs []*Package) *PackageIterator

NewPackageIterator initializes a new iterator.

func (*PackageIterator) Package added in v0.0.3

func (it *PackageIterator) Package() *Package

Package returns the current repo.

func (*PackageIterator) Scan added in v0.0.3

func (it *PackageIterator) Scan() bool

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

type Packages added in v0.0.4

type Packages struct {
	Uuid     string     `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`       // I guess why not just have this on each file
	Version  string     `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // maybe can be used for protobuf schema change violations
	Packages []*Package `protobuf:"bytes,3,rep,name=packages,proto3" json:"packages,omitempty"`
	// contains filtered or unexported fields
}

func (*Packages) All added in v0.0.4

func (r *Packages) All() *PackageIterator

func (*Packages) Append added in v0.0.4

func (r *Packages) Append(newP *Package) bool

enforces no duplicate package names

func (*Packages) Descriptor deprecated added in v0.0.4

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

Deprecated: Use Packages.ProtoReflect.Descriptor instead.

func (*Packages) FindByName added in v0.0.4

func (r *Packages) FindByName(name string) *Package

find a package by name

func (*Packages) FormatJSON added in v0.0.4

func (p *Packages) FormatJSON() string

human readable JSON

func (*Packages) FormatTEXT added in v0.0.4

func (p *Packages) 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()

func (*Packages) GetPackages added in v0.0.4

func (x *Packages) GetPackages() []*Package

func (*Packages) GetUuid added in v0.0.4

func (x *Packages) GetUuid() string

func (*Packages) GetVersion added in v0.0.4

func (x *Packages) GetVersion() string

func (*Packages) Len added in v0.0.4

func (r *Packages) Len() int

func (*Packages) Marshal added in v0.0.4

func (p *Packages) Marshal() ([]byte, error)

marshal to wire

func (*Packages) MarshalJSON added in v0.0.4

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

marshal json

func (*Packages) ProtoMessage added in v0.0.4

func (*Packages) ProtoMessage()

func (*Packages) ProtoReflect added in v0.0.4

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

func (*Packages) Reset added in v0.0.4

func (x *Packages) Reset()

func (*Packages) SortByName added in v0.0.4

func (r *Packages) SortByName() *PackageIterator

func (*Packages) String added in v0.0.4

func (x *Packages) String() string

func (*Packages) Unmarshal added in v0.0.4

func (p *Packages) Unmarshal(data []byte) error

unmarshal from wire

func (*Packages) UnmarshalJSON added in v0.0.4

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

unmarshal

func (*Packages) Update added in v0.0.4

func (r *Packages) Update(newP *Package) bool

Update version and timestamp. returns ok (ok == true if not found)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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