load

package
v0.10.7 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(msg proto.Message, dir string, fmt format.Format, options ...Option) error

Load reads file content from the specified directory and format, and then fills the provided message.

Types

type Option added in v0.9.16

type Option func(*Options)

Option is the functional option type.

func IgnoreUnknownFields added in v0.10.6

func IgnoreUnknownFields(ignore bool) Option

IgnoreUnknownFields sets whether to ignore unknown JSON fields during parsing.

func LocationName added in v0.10.5

func LocationName(name string) Option

LocationName sets TZ location name for parsing datetime format.

func SubdirRewrites added in v0.9.16

func SubdirRewrites(subdirRewrites map[string]string) Option

SubdirRewrites option.

type Options added in v0.9.16

type Options struct {
	// Rewrite subdir path (relative to workbook name option in .proto file).
	// Default: nil.
	SubdirRewrites map[string]string
	// Location represents the collection of time offsets in use in a geographical area.
	// If the name is "" or "UTC", LoadLocation returns UTC.
	// If the name is "Local", LoadLocation returns Local.
	// Default: "Local".
	LocationName string
	// Whether to ignore unknown JSON fields during parsing.
	// Default: false.
	IgnoreUnknownFields bool
}

func ParseOptions added in v0.9.16

func ParseOptions(setters ...Option) *Options

ParseOptions parses functional options and merge them to default Options.

Jump to

Keyboard shortcuts

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