goser

package
v0.0.0-...-aa0246c Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLog

func NewLog(record *Log)

NewLog creates a new log

Types

type CacheStatus

type CacheStatus int32

CacheStatus of goser

const (
	// CACHESTATUSUNKNOWN unknown cache status
	CACHESTATUSUNKNOWN CacheStatus = 0
	// CACHESTATUSMISS miss cache status
	CACHESTATUSMISS CacheStatus = 1
	// CACHESTATUSEXPIRED exipred cache status
	CACHESTATUSEXPIRED CacheStatus = 2
	// CACHESTATUSHIT hit cache status
	CACHESTATUSHIT CacheStatus = 3
)

type Country

type Country int32

Country type

const (
	// COUNTRYUNKNOWN unknwon country
	COUNTRYUNKNOWN Country = 0
	// COUNTRYUS us country
	COUNTRYUS Country = 238
)

type HTTP

type HTTP struct {
	Protocol     HTTPProtocol `json:"protocol"`
	Status       uint32       `json:"status"`
	HostStatus   uint32       `json:"hostStatus"`
	UpStatus     uint32       `json:"upStatus"`
	Method       HTTPMethod   `json:"method"`
	ContentType  string       `json:"contentType"`
	UserAgent    string       `json:"userAgent"`
	Referer      string       `json:"referer"`
	RequestURI   string       `json:"requestURI"`
	Unrecognized []byte       `json:"-"`
}

HTTP struct type

type HTTPMethod

type HTTPMethod int32

HTTPMethod of goser

const (
	// HTTPMETHODUNKNOWN unknown http method
	HTTPMETHODUNKNOWN HTTPMethod = 0
	// HTTPMETHODGET get http method
	HTTPMETHODGET HTTPMethod = 1
	// HTTPMETHODPOST post http method
	HTTPMETHODPOST HTTPMethod = 2
	// HTTPMETHODDELETE delete http method
	HTTPMETHODDELETE HTTPMethod = 3
	// HTTPMETHODPUT put http method
	HTTPMETHODPUT HTTPMethod = 4
	// HTTPMETHODHEAD head http method
	HTTPMETHODHEAD HTTPMethod = 5
	// HTTPMETHODPURGE purge http method
	HTTPMETHODPURGE HTTPMethod = 6
	// HTTPMETHODOPTIONS options http method
	HTTPMETHODOPTIONS HTTPMethod = 7
	// HTTPMETHODPROPFIND propfind http method
	HTTPMETHODPROPFIND HTTPMethod = 8
	// HTTPMETHODMKCOL mkcol http method
	HTTPMETHODMKCOL HTTPMethod = 9
	// HTTPMETHODPATCH patch http method
	HTTPMETHODPATCH HTTPMethod = 10
)

type HTTPProtocol

type HTTPProtocol int32

HTTPProtocol of goser

const (
	// HTTPPROTOCOLUNKNOWN http protocol unknown
	HTTPPROTOCOLUNKNOWN HTTPProtocol = 0
	// HTTPPROTOCOL10 http protocol 10
	HTTPPROTOCOL10 HTTPProtocol = 1
	// HTTPPROTOCOL11 http protocol 11
	HTTPPROTOCOL11 HTTPProtocol = 2
)

type IP

type IP net.IP

IP type

func (IP) MarshalJSON

func (ip IP) MarshalJSON() ([]byte, error)

MarshalJSON set ip to json

func (IP) MarshalJSONBuf

func (ip IP) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf set ip to json with buf

func (*IP) UnmarshalJSON

func (ip *IP) UnmarshalJSON(data []byte) error

UnmarshalJSON umarshall json to ip

type Log

type Log struct {
	Timestamp    int64       `json:"timestamp"`
	ZoneID       uint32      `json:"zoneId"`
	ZonePlan     ZonePlan    `json:"zonePlan"`
	HTTP         HTTP        `json:"http"`
	Origin       Origin      `json:"origin"`
	Country      Country     `json:"country"`
	CacheStatus  CacheStatus `json:"cacheStatus"`
	ServerIP     IP          `json:"serverIp"`
	ServerName   string      `json:"serverName"`
	RemoteIP     IP          `json:"remoteIp"`
	BytesDlv     uint64      `json:"bytesDlv"`
	RayID        string      `json:"rayId"`
	Unrecognized []byte      `json:"-"`
}

Log struct

type Origin

type Origin struct {
	IP       IP             `json:"ip"`
	Port     uint32         `json:"port"`
	Hostname string         `json:"hostname"`
	Protocol OriginProtocol `json:"protocol"`
}

Origin struct

type OriginProtocol

type OriginProtocol int32

OriginProtocol type

const (
	// ORIGINPROTOCOLUNKNOWN origin protocol unknown
	ORIGINPROTOCOLUNKNOWN OriginProtocol = 0
	// ORIGINPROTOCOLHTTP origin protocol http
	ORIGINPROTOCOLHTTP OriginProtocol = 1
	// ORIGINPROTOCOLHTTPS origin protocol https
	ORIGINPROTOCOLHTTPS OriginProtocol = 2
)

type ZonePlan

type ZonePlan int32

ZonePlan type

const (
	// ZONEPLANUNKNOWN unknwon zone plan
	ZONEPLANUNKNOWN ZonePlan = 0
	// ZONEPLANFREE free zone plan
	ZONEPLANFREE ZonePlan = 1
	// ZONEPLANPRO pro zone plan
	ZONEPLANPRO ZonePlan = 2
	// ZONEPLANBIZ biz zone plan
	ZONEPLANBIZ ZonePlan = 3
	// ZONEPLANENT ent zone plan
	ZONEPLANENT ZonePlan = 4
)

Jump to

Keyboard shortcuts

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