configs

package
v0.0.0-...-d77dacb Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvalidOrZeroPortNumberErr = "grps port value is invalid"
)

Variables

This section is empty.

Functions

func GetRootRepositoryPath

func GetRootRepositoryPath() string

func IsDirectory

func IsDirectory(path string) (bool, error)

func ReadConfigFile

func ReadConfigFile(file string, conf *Configs) (err error)

Types

type Configs

type Configs struct {
	IsDebugMode  bool  `yaml:"debugMode" json:"debug_mode"`
	UseProfiling bool  `yaml:"useProfiling" json:"use_profiling"`
	GRPC         *GRPC `yaml:"grpc" json:"grpc"`
}

func (*Configs) Validate

func (c *Configs) Validate() (err error)

type Connection

type Connection struct {
	Host            string        `yaml:"host" json:"host"`
	Port            uint16        `yaml:"port" json:"port"`
	ReadBufferSize  uint          `yaml:"readBufferSize" json:"read_buffer_size"`
	WriteBufferSize uint          `yaml:"writeBufferSize" json:"write_buffer_size"`
	MaxMessageSize  uint          `yaml:"maxMessageSize" json:"max_message_size"`
	Insecure        bool          `yaml:"insecure" json:"insecure"`
	Timeout         time.Duration `yaml:"timeout" json:"timeout"`
}

func (*Connection) MarshalJSON

func (c *Connection) MarshalJSON() ([]byte, error)

func (*Connection) MarshalYAML

func (c *Connection) MarshalYAML() (interface{}, error)

func (*Connection) UnmarshalJSON

func (c *Connection) UnmarshalJSON(data []byte) (err error)

func (*Connection) UnmarshalYAML

func (c *Connection) UnmarshalYAML(unmarshal func(interface{}) error) error

func (*Connection) Validate

func (c *Connection) Validate() (err error)

type EnforcementPolicy

type EnforcementPolicy struct {
	MinTime             time.Duration `yaml:"minTime" json:"min_time"`
	PermitWithoutStream bool          `yaml:"permitWithoutStream" json:"permit_without_stream"`
}

func (*EnforcementPolicy) MarshalJSON

func (ep *EnforcementPolicy) MarshalJSON() ([]byte, error)

func (*EnforcementPolicy) MarshalYAML

func (ep *EnforcementPolicy) MarshalYAML() (interface{}, error)

func (*EnforcementPolicy) UnmarshalJSON

func (ep *EnforcementPolicy) UnmarshalJSON(data []byte) (err error)

func (*EnforcementPolicy) UnmarshalYAML

func (ep *EnforcementPolicy) UnmarshalYAML(unmarshal func(interface{}) error) error

type GRPC

type GRPC struct {
	Enabled       bool
	UseReflection bool        `yaml:"useReflection" json:"use_reflection"`
	Conn          *Connection `yaml:"connection" json:"connection"`
	Keepalive     *Keepalive  `yaml:"keepalive" json:"keepalive"`
}

type Keepalive

type Keepalive struct {
	Time              time.Duration      `yaml:"time" json:"time"`
	Timeout           time.Duration      `yaml:"timeout" json:"timeout"`
	EnforcementPolicy *EnforcementPolicy `yaml:"enforcementPolicy" json:"enforcement_policy"`
}

func (*Keepalive) MarshalJSON

func (ka *Keepalive) MarshalJSON() ([]byte, error)

func (*Keepalive) MarshalYAML

func (ka *Keepalive) MarshalYAML() (interface{}, error)

func (*Keepalive) UnmarshalJSON

func (ka *Keepalive) UnmarshalJSON(data []byte) (err error)

func (*Keepalive) UnmarshalYAML

func (ka *Keepalive) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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