xgoframe

package
v0.0.0-...-b937326 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const ModName = "server.goframe"

ModName mod name

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host          string
	Port          int
	Debug         bool
	DisableMetric bool
	DisableTrace  bool
	// ServiceAddress service address in registry info, default to 'Host:Port'
	ServiceAddress string

	SlowQueryThresholdInMilli int64
	// contains filtered or unexported fields
}

Config HTTP config

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig ...

func RawConfig

func RawConfig(key string) *Config

RawConfig ...

func StdConfig

func StdConfig(name string) *Config

StdConfig Jupiter Standard HTTP Server config

func (*Config) Address

func (config *Config) Address() string

Address ...

func (*Config) Build

func (config *Config) Build() *Server

Build create server instance, then initialize it with necessary interceptor

func (*Config) WithHost

func (config *Config) WithHost(host string) *Config

WithHost ...

func (*Config) WithLogger

func (config *Config) WithLogger(logger *xlog.Logger) *Config

WithLogger ...

func (*Config) WithPort

func (config *Config) WithPort(port int) *Config

WithPort ...

type EmptyMessage

type EmptyMessage struct{}

EmptyMessage ...

func (*EmptyMessage) ProtoMessage

func (*EmptyMessage) ProtoMessage()

ProtoMessage ...

func (*EmptyMessage) Reset

func (m *EmptyMessage) Reset()

Reset ...

func (*EmptyMessage) String

func (m *EmptyMessage) String() string

String ...

type GRPCProxyMessage

type GRPCProxyMessage struct {
	Error   int           `protobuf:"varint,1,opt,name=error" json:"error"`
	Message string        `protobuf:"bytes,2,opt,name=msg" json:"msg"`
	Data    proto.Message `protobuf:"bytes,3,opt,name=data" json:"data"`
}

GRPCProxyMessage ...

func (*GRPCProxyMessage) MarshalJSONPB

func (m *GRPCProxyMessage) MarshalJSONPB(jsb *jsonpb.Marshaler) ([]byte, error)

MarshalJSONPB ...

func (*GRPCProxyMessage) ProtoMessage

func (*GRPCProxyMessage) ProtoMessage()

ProtoMessage ...

func (*GRPCProxyMessage) Reset

func (m *GRPCProxyMessage) Reset()

Reset ...

func (*GRPCProxyMessage) String

func (m *GRPCProxyMessage) String() string

String ...

type Server

type Server struct {
	*ghttp.Server
	// contains filtered or unexported fields
}

Server is server core struct

func (*Server) GracefulStop

func (s *Server) GracefulStop(ctx context.Context) error

GracefulStop ..

func (*Server) Info

func (s *Server) Info() *server.ServiceInfo

Info ..

func (*Server) Serve

func (s *Server) Serve() error

Serve ..

func (*Server) Stop

func (s *Server) Stop() error

Stop ..

Jump to

Keyboard shortcuts

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