module

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PARSER_BASIC = iota
	PARSER_JSON
	PARSER_XML
	PARSER_YAML
	PARSER_TOML
)
View Source
const (
	SERVICE_TYPE_GRPC = "grpc"
	SERVICE_TYPE_HTTP = "http"
)
View Source
const (
	AUTO_IP_DONOTHING = iota
	AUTO_IP
	AUTO_IP_PUBLIC
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthImpl

type HealthImpl struct{}

type Module

type Module struct {
	// contains filtered or unexported fields
}

func New

func New(conf *config.ModuleConfig) *Module

func (*Module) GetConfig

func (m *Module) GetConfig(key string) ([]byte, error)

func (*Module) GetConfigWithParser

func (m *Module) GetConfigWithParser(key string, parser int, value any, funcList ...func([]byte) ([]byte, error)) error

func (*Module) GetModuleConfig

func (m *Module) GetModuleConfig(key string) ([]byte, error)

func (*Module) GetModuleConfigWithParser

func (m *Module) GetModuleConfigWithParser(key string, parser int, value any, funcList ...func([]byte) ([]byte, error)) error

func (*Module) GetPath

func (m *Module) GetPath() string

func (*Module) GrpcService

func (m *Module) GrpcService(conf *config.GrpServiceConfig) error

func (*Module) HttpService

func (m *Module) HttpService(conf *config.HttpServiceConfig) error

func (*Module) NewGrpcClientConn

func (m *Module) NewGrpcClientConn() (*grpc.ClientConn, error)

func (*Module) NewHttpClientConn

func (m *Module) NewHttpClientConn() *http.ClientConn

func (*Module) SetConfig

func (m *Module) SetConfig(key string, value []byte) error

func (*Module) SetConfigWithParser

func (m *Module) SetConfigWithParser(key string, parser int, value any, funcList ...func([]byte) ([]byte, error)) error

func (*Module) SetModuleConfig

func (m *Module) SetModuleConfig(key string, value []byte) error

func (*Module) SetModuleConfigWithParser

func (m *Module) SetModuleConfigWithParser(key string, parser int, value any, funcList ...func([]byte) ([]byte, error)) error

type Parser

type Parser interface {
	Unmarshal([]byte, any) error
	Marshal(any) ([]byte, error)
}

type ParserBasic

type ParserBasic struct{}

func (*ParserBasic) Marshal

func (p *ParserBasic) Marshal(value any) ([]byte, error)

func (*ParserBasic) Unmarshal

func (p *ParserBasic) Unmarshal(data []byte, value any) error

type ParserJson

type ParserJson struct{}

func (*ParserJson) Marshal

func (p *ParserJson) Marshal(value any) ([]byte, error)

func (*ParserJson) Unmarshal

func (p *ParserJson) Unmarshal(data []byte, value any) error

type ParserToml

type ParserToml struct{}

func (*ParserToml) Marshal

func (p *ParserToml) Marshal(value any) ([]byte, error)

func (*ParserToml) Unmarshal

func (p *ParserToml) Unmarshal(data []byte, value any) error

type ParserXml

type ParserXml struct{}

func (*ParserXml) Marshal

func (p *ParserXml) Marshal(value any) ([]byte, error)

func (*ParserXml) Unmarshal

func (p *ParserXml) Unmarshal(data []byte, value any) error

type ParserYaml

type ParserYaml struct{}

func (*ParserYaml) Marshal

func (p *ParserYaml) Marshal(value any) ([]byte, error)

func (*ParserYaml) Unmarshal

func (p *ParserYaml) Unmarshal(data []byte, value any) error

Jump to

Keyboard shortcuts

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