Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Format ¶
type Format int
const ( JSON Format = 0 Protowire Format = 1 Prototext Format = 2 Excel Format = 3 CSV Format = 4 XML Format = 5 )
file format
func Ext2Format ¶ added in v0.7.5
type HeaderOption ¶
type InputOption ¶ added in v0.7.5
type InputOption struct {
Format Format
}
type Option ¶
type Option func(*Options)
Option is the functional option type.
func Header ¶
func Header(o *HeaderOption) Option
func Input ¶ added in v0.7.5
func Input(o *InputOption) Option
func LocationName ¶
func Output ¶
func Output(o *OutputOption) Option
type Options ¶
type Options struct { LocationName string // Location represents the collection of time offsets in use in a geographical area. Default is "Asia/Shanghai". LogLevel string // Log level: debug, info, warn, error Header *HeaderOption // header rows of excel file. Output *OutputOption // output settings. Input *InputOption // input settings. Imports []string // imported common proto file paths Workbook string // workbook path or name Worksheet string // worksheet name }
Options is the wrapper of tableau params. Options follow the design of Functional Options (https://github.com/tmrts/go-patterns/blob/master/idiom/functional-options.md).
func ParseOptions ¶
type OutputOption ¶
type OutputOption struct { // only for protogen generated protoconf file FilenameWithSubdirPrefix bool // default true, filename dir separator `/` or `\` is replaced by "__" FilenameSuffix string // only for confgen generated JSON/prototext/protowire file FilenameAsSnakeCase bool // default false, output filename as snake case, default is camel case same as the protobuf message name. Format Format // output pretty format, with mulitline and indent. Pretty bool // default true, output format: json, protowire, or prototext, and default is json. // Output.EmitUnpopulated specifies whether to emit unpopulated fields. It does not // emit unpopulated oneof fields or unpopulated extension fields. // The JSON value emitted for unpopulated fields are as follows: // ╔═══════╤════════════════════════════╗ // ║ JSON │ Protobuf field ║ // ╠═══════╪════════════════════════════╣ // ║ false │ proto3 boolean fields ║ // ║ 0 │ proto3 numeric fields ║ // ║ "" │ proto3 string/bytes fields ║ // ║ null │ proto2 scalar fields ║ // ║ null │ message fields ║ // ║ [] │ list fields ║ // ║ {} │ map fields ║ // ╚═══════╧════════════════════════════╝ EmitUnpopulated bool // default true }
Click to show internal directories.
Click to hide internal directories.