FlyAPIs

package
v0.0.0-...-482d8b5 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API_Resp

type API_Resp struct {
	Result bool        `json:"result"`
	Code   int         `json:"code"`
	Data   interface{} `json:"data"`
}

type FlyApi

type FlyApi struct {
	W              http.ResponseWriter
	R              *http.Request
	ServerSettings FlyApiSettings
}

func NewFlyApi

func NewFlyApi(w http.ResponseWriter, r *http.Request, settings FlyApiSettings) *FlyApi

func (*FlyApi) Err

func (s *FlyApi) Err(data interface{}) API_Resp

func (*FlyApi) Ok

func (s *FlyApi) Ok(data interface{}) API_Resp

func (*FlyApi) V

func (s *FlyApi) V(key string, defaults string) string

func (*FlyApi) VBase64

func (s *FlyApi) VBase64(key string, defaults []byte) []byte

func (*FlyApi) VBool

func (s *FlyApi) VBool(key string, defaults bool) bool

func (*FlyApi) VFloat64

func (s *FlyApi) VFloat64(key string, defaults float64) float64

func (*FlyApi) VInt

func (s *FlyApi) VInt(key string, defaults int) int

func (*FlyApi) VInt64

func (s *FlyApi) VInt64(key string, defaults int64) int64

func (*FlyApi) VString

func (s *FlyApi) VString(key string, defaults string) string

type FlyApiServer

type FlyApiServer struct {
	Settings  *FlyApiSettings
	Server    *http.Server
	ServerMux *http.ServeMux
	Ready     bool
}

func NewFlyApiServer

func NewFlyApiServer() *FlyApiServer

func (*FlyApiServer) Handle

func (s *FlyApiServer) Handle(pattern string, handler http.Handler)

func (*FlyApiServer) HandleApi

func (s *FlyApiServer) HandleApi(pattern string, handler func(*FlyApi) any) (err error)

func (*FlyApiServer) HandleFunc

func (s *FlyApiServer) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))

func (*FlyApiServer) LoadSettings

func (s *FlyApiServer) LoadSettings(settings *FlyApiSettings)

func (*FlyApiServer) Open

func (s *FlyApiServer) Open(settings *FlyApiSettings) error

从ini加载配置信息

func (*FlyApiServer) Start

func (s *FlyApiServer) Start() error

type FlyApiServerBasicInterface

type FlyApiServerBasicInterface interface {
	Handle(pattern string, handler http.Handler)
	HandleFunc(string, func(http.ResponseWriter, *http.Request))
}

type FlyApiSettings

type FlyApiSettings struct {
	Enable     bool
	ConfigType string
	ConfigKey  string
	Debug      bool

	Addr  string
	Token string

	Ready bool
}

func NewFlyApiSettings

func NewFlyApiSettings() *FlyApiSettings

func (*FlyApiSettings) LoadIni

func (s *FlyApiSettings) LoadIni(config *FlyConfigFile.FlyIni, key string) error

从ini加载配置信息

Jump to

Keyboard shortcuts

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