app

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	AppName     string
	ServiceName string
	ServerHost  string
	ServerPort  uint64
	EtcdClient  *clientv3.Client
}

func NewApp

func NewApp(p Conf) App

func (*App) Deregister

func (a *App) Deregister()

func (*App) Register

func (a *App) Register()

func (*App) StartGrpcServer

func (a *App) StartGrpcServer(register func(srv *grpc.Server))

func (*App) StartHttpServer

func (a *App) StartHttpServer(handler http.Handler)

type Conf

type Conf struct {
	AppName     string `yaml:"app_name"`
	ServiceName string
	ServerHost  string `yaml:"server_host"`
	ServerPort  uint64 `yaml:"server_port"`
	EtcdAddress string `yaml:"etcd_address"`
}

func FromEnv

func FromEnv(serviceName string) Conf

func RPCFromEnv

func RPCFromEnv(serviceName string) Conf

Jump to

Keyboard shortcuts

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