Documentation ¶
Index ¶
Constants ¶
const ( Json = "json" JsonIndent = "json-indent" Text = "text" TextIndent = "text-indent" Hex = "hex" HexIndent = "hex-indent" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileLoader ¶
type FileLoader struct {
// contains filtered or unexported fields
}
FileLoader is an implementation of Loader interface to load the proto files from the disk.
func NewFileLoader ¶
func NewFileLoader(root string, files ...string) (*FileLoader, error)
NewFileLoader creates a new instance of local file loader.
func (*FileLoader) Get ¶
func (f *FileLoader) Get(messageName string) (*dynamic.Message, error)
Get creates a new instance of the specified protocol buffer message.
The input parameter must be the fully qualified name of the message type. The method will return an error if the specified message type does not exist in the path.
func (*FileLoader) List ¶
func (f *FileLoader) List(search *regexp.Regexp) ([]string, error)
List returns a list of all the protocol buffer messages exist in the path.
func (*FileLoader) Load ¶
func (f *FileLoader) Load(messageName string) error
Load loads the specified message type into the local cache.
The input parameter must be the fully qualified name of the message type. The method will return an error if the specified message type does not exist in the path.
Calling load is not thread safe.
type Loader ¶
type Loader interface { Load(messageName string) error Get(messageName string) (*dynamic.Message, error) List(filter *regexp.Regexp) ([]string, error) }
Loader the interface to load and list the protocol buffer message types.
type Marshaller ¶
type Marshaller struct {
// contains filtered or unexported fields
}
func NewMarshaller ¶
func NewMarshaller(format string, includeTimeStamp bool) *Marshaller