Documentation ¶
Index ¶
Constants ¶
const INDENT = " "
INDENT are the characters used for indenting code.
Variables ¶
This section is empty.
Functions ¶
func CamelToSnakeCase ¶
CamelToSnakeCase converts identifier in camel case (FooBarBaz) to snake case (foo_bar_baz)
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator takes a FileDescriptor (a helper type which is just a thin wrapper around a FileDescriptorProto) and a generates a YARA module for the protocol buffer defined by the FileDescriptor. See: https://godoc.org/github.com/jhump/protoreflect/desc#FileDescriptor https://godoc.org/github.com/golang/protobuf/protoc-gen-go/descriptor#FileDescriptorProto
func (*Generator) Parse ¶
Parse receive a FileDescriptor describing a .proto file and writes the source code for the corresponding YARA module into the provided writer. The .proto file must include a snippet similar to the one below.
import "yara.proto" package "foo" option (yara.module_options) = { name : "foo" root_message: "foo.FooMessage"; };
These options are required for the generator to be able to generate the YARA module.