check

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityConf

type ActivityConf struct {
	tableau.ActivityConf
}

func (*ActivityConf) Check

func (x *ActivityConf) Check(hub *tableau.Hub) error

func (*ActivityConf) CheckCompatibility

func (x *ActivityConf) CheckCompatibility(hub, newHub *tableau.Hub) error

type ChapterConf

type ChapterConf struct {
	tableau.ChapterConf
}

func (*ChapterConf) Check

func (x *ChapterConf) Check(hub *tableau.Hub) error

func (*ChapterConf) CheckCompatibility

func (x *ChapterConf) CheckCompatibility(hub, newHub *tableau.Hub) error

type Hub

type Hub struct {
	*tableau.Hub
	// contains filtered or unexported fields
}

func NewHub

func NewHub() *Hub

func (*Hub) Check

func (h *Hub) Check(dir string, format format.Format, options ...Option) error

func (*Hub) CheckCompatibility

func (h *Hub) CheckCompatibility(dir, newDir string, format format.Format, options ...Option) error

type ItemConf

type ItemConf struct {
	tableau.ItemConf
}

func (*ItemConf) Check

func (x *ItemConf) Check(hub *tableau.Hub) error

func (*ItemConf) CheckCompatibility

func (x *ItemConf) CheckCompatibility(hub, newHub *tableau.Hub) error

type Option

type Option func(*Options)

Option is the functional option type.

func BreakFailedCount

func BreakFailedCount(count int) Option

BreakFailedCount sets BreakFailedCount option.

func Filter

func Filter(filter load.FilterFunc) Option

Filter can only filter in certain specific messagers based on the condition that you provide.

func IgnoreUnknownFields

func IgnoreUnknownFields() Option

IgnoreUnknownFields sets IgnoreUnknownFields option as true.

func Paths

func Paths(paths map[string]string) Option

Paths maps each messager name to a corresponding config file path. If specified, then the main messager will be parsed from the file directly, other than the specified load dir.

NOTE: only JSON, Bin, and Text formats are supported.

func ProtoPackage

func ProtoPackage(protoPackage string) Option

ProtoPackage sets ProtoPackage option.

func SkipLoadErrors

func SkipLoadErrors() Option

SkipLoadErrors sets SkipLoadErrors option as true.

func SubdirRewrites

func SubdirRewrites(subdirRewrites map[string]string) Option

SubdirRewrites sets SubdirRewrites option.

type Options

type Options struct {
	// Filter can only filter in certain specific messagers based on the
	// condition that you provide.
	//
	// Default: nil.
	Filter load.FilterFunc
	// Break check loop if failed count is equal to or more than BreakFailedCount.
	//
	// Default: 1.
	BreakFailedCount int
	// Rewrite subdir path (relative to workbook name option in .proto file).
	//
	// Default: nil.
	SubdirRewrites map[string]string
	// The proto package name of .proto files.
	//
	// Default: "protoconf".
	ProtoPackage string
	// Whether to ignore unknown JSON fields during parsing.
	//
	// Default: false.
	IgnoreUnknownFields bool
	// Whether to ignore errors during loading.
	//
	// Errors may occur during loading old config files when do compatibility
	// check. For example, some new worksheets you recently add are not
	// existed, or proto schema are not compatible, just ignore the loading
	// errors (then these proto message objects are nil after loading), so that
	// compatibility check can continue to run.
	//
	// Default: false.
	SkipLoadErrors bool
	// Paths maps each messager name to a corresponding config file path.
	// If specified, then the main messager will be parsed from the file
	// directly, other than the specified load dir.
	//
	// NOTE: only JSON, Bin, and Text formats are supported.
	//
	// Default: nil.
	Paths map[string]string
}

func ParseOptions

func ParseOptions(setters ...Option) *Options

ParseOptions parses functional options and merge them to default Options.

type ThemeConf

type ThemeConf struct {
	tableau.ThemeConf
}

func (*ThemeConf) Check

func (x *ThemeConf) Check(hub *tableau.Hub) error

func (*ThemeConf) CheckCompatibility

func (x *ThemeConf) CheckCompatibility(hub, newHub *tableau.Hub) error

Jump to

Keyboard shortcuts

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