Documentation ¶
Index ¶
- Variables
- type GenerateTarget
- type ProtoDependency
- type Protobuf
- func (p *Protobuf) CompileToDescriptorSet() error
- func (p *Protobuf) Contents(filename string) ([]byte, error)
- func (p *Protobuf) DescriptorBytes() []byte
- func (p *Protobuf) DescriptorReader() io.ReadSeeker
- func (p *Protobuf) Descriptors() (*ProtobufDescriptors, error)
- func (p *Protobuf) DocJSON(filename string) ([]byte, error)
- func (p Protobuf) GenerateTo(target GenerateTarget, prefix string) (tempOut string, rm func(), err error)
- func (p *Protobuf) GetDescriptors() (map[string]*desc.FileDescriptor, error)
- func (p *Protobuf) Raw() []byte
- func (p *Protobuf) RawFilename() string
- func (p *Protobuf) RawReader() io.ReadSeeker
- func (p *Protobuf) SHA256() (string, error)
- func (p *Protobuf) SetDescriptor(raw []byte)
- func (p *Protobuf) SetRaw(raw []byte)
- func (p *Protobuf) SetRawFromBase64(body string) error
- type ProtobufDescriptors
- type ProtobufMessage
Constants ¶
This section is empty.
Variables ¶
var TestProtoDescriptorSet = descriptorSetBase64
var TestProtoZip = testProtoZip
exports for API tests
Functions ¶
This section is empty.
Types ¶
type GenerateTarget ¶
type GenerateTarget int
const ( GenerateTargetCPP GenerateTarget GenerateTargetCSharp GenerateTargetJava GenerateTargetJavaNano GenerateTargetJS GenerateTargetObjC GenerateTargetPHP GenerateTargetPython GenerateTargetRuby GenerateTargetGo )
type ProtoDependency ¶
type Protobuf ¶
type Protobuf struct { ID *string `json:"id"` Name *string `json:"name"` Version *string `json:"version"` LastUpdated time.Time `json:"lastUpdated"` Dependencies []*ProtoDependency `json:"dependencies"` // contains filtered or unexported fields }
Protobuf represents a single versioned protobuf package. It implements methods for utility functions across different packages. Storage and Database providers are responsible for setting, storing, and retrieving the raw data.
func (*Protobuf) CompileToDescriptorSet ¶
func (*Protobuf) DescriptorBytes ¶
DescriptorBytes returns the descriptor set bytes for the protobuf object
func (*Protobuf) DescriptorReader ¶
func (p *Protobuf) DescriptorReader() io.ReadSeeker
DescriptorReader returns a ReadSeeker for the raw desciptor set
func (*Protobuf) Descriptors ¶
func (p *Protobuf) Descriptors() (*ProtobufDescriptors, error)
Descriptors returns the human-readable representation of the raw file descriptors for this object
func (Protobuf) GenerateTo ¶
func (p Protobuf) GenerateTo(target GenerateTarget, prefix string) (tempOut string, rm func(), err error)
func (*Protobuf) GetDescriptors ¶
func (p *Protobuf) GetDescriptors() (map[string]*desc.FileDescriptor, error)
GetDescriptors returns the raw file descriptors for a protobuf object This is primarily a helper for functions that return more human readable formats
func (*Protobuf) RawFilename ¶
RawFilename returns a zip filename for the protobuf object
func (*Protobuf) RawReader ¶
func (p *Protobuf) RawReader() io.ReadSeeker
RawReader returns a ReadSeeker for the raw zip data - useful for serving in http requests
func (*Protobuf) SetDescriptor ¶
SetDescritptor sets the raw descriptor set from a byte slice
func (*Protobuf) SetRawFromBase64 ¶
SetRawFromBase64 sets the raw protobuf data from a base64 string
type ProtobufDescriptors ¶
type ProtobufDescriptors struct { Messages []*ProtobufMessage `json:"messages"` SourceFiles []string `json:"sourceFiles"` // Will add more as they are needed JavaPackages []*string `json:"javaPackages,omitempty"` GoPackages []*string `json:"goPackages,omitempty"` }
ProtobufDescriptors is a more human readable representation of raw file descriptors
type ProtobufMessage ¶
ProtoMessage is a more human-readable representation of raw message descriptors