Documentation
¶
Index ¶
- Constants
- Variables
- func ClientIP(r *http.Request) string
- func Cros(w http.ResponseWriter, req *http.Request, headers ...map[string]string)
- func E(err error)
- func MetaDevide(ctx context.Context, out ...bool) string
- func MetaFp(ctx context.Context, out ...bool) string
- func MetaHost(ctx context.Context, out ...bool) string
- func MetaInt(ctx context.Context, key string, out ...bool) int
- func MetaIp(ctx context.Context, out ...bool) string
- func MetaLang(ctx context.Context, out ...bool) string
- func MetaMethod(ctx context.Context, out ...bool) string
- func MetaString(ctx context.Context, key string, out ...bool) string
- func MetaToken(ctx context.Context, out ...bool) string
- func Response(w http.ResponseWriter, code int, msg ...string)
- func StargoHTTPError(ctx context.Context, mux *runtime.ServeMux, marshaler runtime.Marshaler, ...)
- func Success(w http.ResponseWriter, msg ...string)
- type APIError
- type Api
- type Config
- type Request
- type RequestData
Constants ¶
View Source
const ( META_FP = "Stargo-Fp" META_TOKEN = "Stargo-Token" META_METHOD = "Stargo-Method" META_IP = "Stargo-IP" META_HOST = "Stargo-Host" META_LANG = "Stargo-Lang" META_DEVICE = "Stargo-Device" )
Variables ¶
View Source
var ( AllowHeaders = []string{"Content-Type", "Origin", "Authorization", "Content-Type", "X-Requested-With", "Accept", "Access-Control-Allow-Credentials", "Access-Token", "Access-Fp", "Accept-Language", "Accept-Device", } AllowMethods = []string{"GET", "HEAD", "POST", "PUT", "DELETE"} )
Functions ¶
func MetaString ¶ added in v0.1.8
func StargoHTTPError ¶ added in v0.1.8
func Success ¶
func Success(w http.ResponseWriter, msg ...string)
Types ¶
type Api ¶ added in v0.1.6
type Api struct {
// contains filtered or unexported fields
}
func (*Api) Conn ¶ added in v0.1.6
func (e *Api) Conn() *grpc.ClientConn
func (*Api) WrapperSwagger ¶ added in v0.1.8
type Request ¶
type Request struct { Data RequestData Query url.Values // contains filtered or unexported fields }
func NewRequest ¶ added in v0.1.8
type RequestData ¶
func (RequestData) Set ¶
func (e RequestData) Set(key string, value any) RequestData
Click to show internal directories.
Click to hide internal directories.