service

package
v0.0.0-...-9d05754 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	APPID     = "wx374a0f37b50eb5ce"
	APPSECRET = "1ffa637e5224634a85228c825289c548"
)

Variables

View Source
var (
	App = &Service{}
)

Functions

func StartHttpService

func StartHttpService() error

func StartService

func StartService() error

Types

type ClientConfig

type ClientConfig struct {
	AntServiceName string `yaml:"antServiceName" json:"antServiceName"`
}

type Config

type Config struct {
	Log        *LogConfig        `yaml:"log" json:"log"`
	Etcd       *EtcdConfig       `yaml:"etcd" json:"etcd"`
	Server     *ServerConfig     `yaml:"server" json:"server"`
	HttpServer *HttpServerConfig `yaml:"httpServer" json:"httpServer"`
	Database   *DatabaseConfig   `yaml:"database" json:"database"`
	Client     *ClientConfig     `yaml:"client" json:"client"`
}

type DatabaseConfig

type DatabaseConfig struct {
	Address    string `yaml:"address" json:"address"`
	Username   string `yaml:"username" json:"username"`
	Password   string `yaml:"password" json:"password"`
	DriverName string `yaml:"driverName" json:"driverName"`
	DbName     string `yaml:"dbName" json:"dbName"`
}

type EtcdConfig

type EtcdConfig struct {
	Endpoints []string `yaml:"endpoints" json:"endpoints"`
}

type HandlerServiceFunc

type HandlerServiceFunc func([]byte) ([]byte, error)

type HttpServer

type HttpServer struct {
	ServiceName string
	Port        string
}

func (*HttpServer) StartHttpServer

func (h *HttpServer) StartHttpServer(httpService *HttpService)

type HttpServerConfig

type HttpServerConfig struct {
	Port string `yaml:"port" json:"port"`
}

type HttpService

type HttpService struct {
	ServiceApp *Service
}

func (*HttpService) AddUser

func (h *HttpService) AddUser(reqData []byte) (interface{}, error)

func (*HttpService) DelUser

func (h *HttpService) DelUser(reqData []byte) (interface{}, error)

func (*HttpService) GetUser

func (h *HttpService) GetUser(reqData []byte) (interface{}, error)

func (*HttpService) GetUserIdByPhoneNumber

func (h *HttpService) GetUserIdByPhoneNumber(reqData []byte) (interface{}, error)

func (*HttpService) GetUsersByName

func (h *HttpService) GetUsersByName(reqData []byte) (interface{}, error)

func (*HttpService) ModifyUserInfo

func (h *HttpService) ModifyUserInfo(reqData []byte) (interface{}, error)

type LogConfig

type LogConfig struct {
	LogPath  string `yaml:"logPath" json:"logPath"`
	LogLevel string `yaml:"logLevel" json:"logLevel"`
}

type ServerConfig

type ServerConfig struct {
	Name string `yaml:"name" json:"name"`
	Port string `yaml:"port" json:"port"`
}

type Service

type Service struct {
	Config *Config
	// contains filtered or unexported fields
}

func (*Service) AddUser

func (*Service) AddUserInfo

func (*Service) DelUser

func (*Service) GetUser

func (*Service) GetUsersByName

func (*Service) Login

func (*Service) ModifyUserInfo

type WxUserInfo

type WxUserInfo struct {
	Openid     string `json:"openid,omitempty"`
	SessionKey string `json:"session_key,omitempty"`
	Unionid    string `json:"unionid,omitempty"`
	Errcode    int    `json:"errcode,omitempty"`
	Errmsg     string `json:"errmsg,omitempty"`
}

Jump to

Keyboard shortcuts

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