bugpb

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2025 License: GPL-3.0 Imports: 14 Imported by: 3

README

This package should be a GO Primitive package and therefore have a minimum go.sum file.

TODO: Appeal to have google.golang.org/protobuf moved into GO itself

protobuf definition files for git-bug

This is to make a easy way to parse the bugs from the federated git-bug system. Search can be implemented on top of this protobuf definition instead of being mixed in with the database code.

The above was the original intent of this package and probably will still be that way, but, this is a good name for "bugs" in protobufs themselves and I've moved things like the Validate UTF-8 things here.

In general, maybe it'll be more of a toolbox of common useful protobuf routines

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Init

func Init() bool

func SanitizeProtoUTF8 added in v0.0.5

func SanitizeProtoUTF8(msg proto.Message) error

SanitizeProtoUTF8 fixes all invalid UTF-8 strings in a proto.Message recursively.

func ValidateProtoUTF8 added in v0.0.5

func ValidateProtoUTF8(msg proto.Message) error

ValidateProtoUTF8 checks all string fields in a proto.Message recursively.

Types

type Bug added in v0.0.2

type Bug struct {
	sync.RWMutex // auto-added by go.wit.com/apps/autogenpb

	Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

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

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

Deprecated: Use Bug.ProtoReflect.Descriptor instead.

func (*Bug) GetName added in v0.0.2

func (x *Bug) GetName() string

func (*Bug) GetUuid added in v0.0.2

func (x *Bug) GetUuid() string

func (*Bug) ProtoMessage added in v0.0.2

func (*Bug) ProtoMessage()

func (*Bug) ProtoReflect added in v0.0.2

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

func (*Bug) Reset added in v0.0.2

func (x *Bug) Reset()

func (*Bug) String added in v0.0.2

func (x *Bug) String() string

type BugScanner added in v0.0.2

type BugScanner struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*BugScanner) Next added in v0.0.2

func (it *BugScanner) Next() *Bug

Next() returns the next thing in the array

func (*BugScanner) Scan added in v0.0.2

func (it *BugScanner) Scan() bool

type Bugs added in v0.0.2

type Bugs struct {
	sync.RWMutex // auto-added by go.wit.com/apps/autogenpb

	Uuid    string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`       // `autogenpb:uuid:cdf6711e-f948-4376-9e72-cf1912a96cee`
	Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // `autogenpb:version:v1`
	Bugs    []*Bug `protobuf:"bytes,3,rep,name=Bugs,proto3" json:"Bugs,omitempty"`       // this never gets used, but it's not worth violating the autogenpb standard
	// contains filtered or unexported fields
}

func NewBugs added in v0.0.2

func NewBugs() *Bugs

func (*Bugs) All added in v0.0.2

func (x *Bugs) All() *BugScanner

func (*Bugs) Append added in v0.0.2

func (x *Bugs) Append(y *Bug)

just a simple Append() shortcut (but still uses the mutex lock)

func (*Bugs) Delete added in v0.0.2

func (x *Bugs) Delete(y *Bug) bool

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

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

Deprecated: Use Bugs.ProtoReflect.Descriptor instead.

func (*Bugs) FormatJSON added in v0.0.2

func (v *Bugs) FormatJSON() string

human readable JSON

func (*Bugs) FormatTEXT added in v0.0.2

func (v *Bugs) FormatTEXT() string

apparently this isn't stable, but it's awesomely better https://protobuf.dev/reference/go/faq/#unstable-text it's brilliant for config files!

func (*Bugs) GetBugs added in v0.0.2

func (x *Bugs) GetBugs() []*Bug

func (*Bugs) GetUuid added in v0.0.2

func (x *Bugs) GetUuid() string

func (*Bugs) GetVersion added in v0.0.2

func (x *Bugs) GetVersion() string

func (*Bugs) IterAll added in v0.0.2

func (x *Bugs) IterAll() iter.Seq[*Bug]

Iterate 'for x := range' syntax using the awesome golang 1.24 'iter'

func (*Bugs) Len added in v0.0.2

func (x *Bugs) Len() int

func (*Bugs) Marshal added in v0.0.2

func (v *Bugs) Marshal() ([]byte, error)

marshal to wire. This is called winning.

func (*Bugs) MarshalJSON added in v0.0.2

func (v *Bugs) MarshalJSON() ([]byte, error)

marshal json

func (*Bugs) ProtoMessage added in v0.0.2

func (*Bugs) ProtoMessage()

func (*Bugs) ProtoReflect added in v0.0.2

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

func (*Bugs) Reset added in v0.0.2

func (x *Bugs) Reset()

func (*Bugs) String added in v0.0.2

func (x *Bugs) String() string

func (*Bugs) Unmarshal added in v0.0.2

func (v *Bugs) Unmarshal(data []byte) error

unmarshal from wire. You have won.

func (*Bugs) UnmarshalJSON added in v0.0.2

func (v *Bugs) UnmarshalJSON(data []byte) error

unmarshal json

func (*Bugs) UnmarshalTEXT added in v0.0.2

func (v *Bugs) UnmarshalTEXT(data []byte) error

unmarshalTEXT. This reads the .text config file back in after the user edits it

type BugsScanner added in v0.0.2

type BugsScanner struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*BugsScanner) Next added in v0.0.2

func (it *BugsScanner) Next() *Bugs

Next() returns the next thing in the array

func (*BugsScanner) Scan added in v0.0.2

func (it *BugsScanner) Scan() bool

Jump to

Keyboard shortcuts

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