config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config contains configuration of the generator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Log    Log
	Search Search
	Print  Print

	Timeout       time.Duration `default:"1m" usage:"timeout for analysis and code printer"`
	Version       bool          `default:"false" usage:"prints version of the app"`
	ExampleConfig bool          `default:"false" usage:"prints example of the json config"`
	ExampleEnv    bool          `default:"false" usage:"prints example of the env config"`
}

Config full configuration of the app.

func Load

func Load() (*Config, error)

Load parse config params and returns app config.

type Content

type Content struct {
	HideVersion        bool   `default:"false" usage:"do not prints app version in the generated files"`
	TagsServer         string `default:"" usage:"prints additional tags to server generated file, example: 'go:build some_tag'"`
	TagsClients        string `default:"" usage:"prints additional tags to client generated file, example: 'go:build some_tag'"`
	WithServiceName    bool   `default:"false" usage:"adds service name as prefix of the method name"`
	SwaggerDataPath    string `default:"" usage:"path to file with swagger additional data"`
	SwaggerInfoVersion string `default:"v0.0.0-unknown" usage:"version of the service in the swagger spec 'info.version'"`
}

Content additional content of the generated code.

type Log

type Log struct {
	Debug   bool `default:"false" usage:"prints debug messages of the generator"`
	Quiet   bool `default:"false" usage:"does not print any messages other than errors"`
	Pretty  bool `default:"true" usage:"prints pretty log messages"`
	NoColor bool `default:"false" usage:"prints log messages without color"`
}

Log configuration.

type Place

type Place struct {
	Stdout          bool   `default:"false" usage:"prints generated files to stdout"`
	PathServer      string `default:"./rpcserver" usage:"path to write generated file with server side code"`
	PathClient      string `default:"./rpcclient" usage:"path to write generated file with client side code"`
	PathSwaggerFile string `default:"" usage:"path to file with swagger spec (/path/to/swagger.json)"`
}

Place of the new file.

type Print

type Print struct {
	Place   Place
	Content Content
}

Print is a config of the rules and destination of the generated files.

type Search struct {
	Name           string `default:"" usage:"name of the interface to generate rpc service"`
	Path           string `default:"." usage:"directory of the searching"`
	KnownTypesPath string `default:"" usage:"path to file with known types"`
}

Search is a config of the service searching.

Jump to

Keyboard shortcuts

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