meta

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HostName

func HostName() string

func IPV4

func IPV4() string

func InstanceId

func InstanceId() string

func Middleware

func Middleware(r *ghttp.Request)

func ServiceName

func ServiceName() string

func StartedAt

func StartedAt() time.Time

Types

type Meta

type Meta struct {
	User    *User    `json:"user,omitempty"`
	Request *Request `json:"request,omitempty"`
	Server  *Server  `json:"server,omitempty"`
}

func FromCtx

func FromCtx(ctx context.Context) *Meta

type Request

type Request struct {
	Method        string `json:"method"`
	Url           string `json:"url"`
	RemoteAddr    string `json:"remote_addr"`
	WebServerName string `json:"web_server_name"`
	EnterTime     int64  `json:"enter_time"`
	TraceId       string `json:"trace_id"`
}

type Server

type Server struct {
	ServiceName string `json:"service_name"`
	HostName    string `json:"host_name"`
	InstanceId  string `json:"instance_id"`
}

func ServerInfo

func ServerInfo() Server

type User

type User struct {
	UserId   interface{} `json:"user_id,omitempty"`
	UserName interface{} `json:"user_name,omitempty"`
	UserFrom interface{} `json:"user_from,omitempty"`
	AppId    interface{} `json:"app_id,omitempty"`
}

Jump to

Keyboard shortcuts

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