nginx

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

json 包,该包包含了用于resolve包中nginx配置对象json反序列化的相关对象和方法及函数 创建者: ClessLi 创建时间: 2020-4-13 09:37:01

Index

Constants

This section is empty.

Variables

View Source
var (
	RegEventsHead      = regexp.MustCompile(`^\s*{\s*"events"\s*:\s*{`)
	RegHttpHead        = regexp.MustCompile(`^\s*{\s*"http"\s*:\s*{`)
	RegStreamHead      = regexp.MustCompile(`^\s*{\s*"stream"\s*:\s*{`)
	RegServerHead      = regexp.MustCompile(`^\s*{\s*"server"\s*:\s*{`)
	RegLocationHead    = regexp.MustCompile(`^\s*{\s*"location"\s*:\s*{`)
	RegIfHead          = regexp.MustCompile(`^\s*{\s*"if"\s*:\s*{`)
	RegUpstreamHead    = regexp.MustCompile(`^\s*{\s*"upstream"\s*:\s*{`)
	RegGeoHead         = regexp.MustCompile(`^\s*{\s*"geo"\s*:\s*{`)
	RegMapHead         = regexp.MustCompile(`^\s*{\s*"map"\s*:\s*{`)
	RegLimitExceptHead = regexp.MustCompile(`^\s*{\s*"limit_except"\s*:\s*{`)
	RegTypesHead       = regexp.MustCompile(`^\s*{\s*"types"\s*:\s*{`)
	RegIncludeHead     = regexp.MustCompile(`^\s*{\s*"include"\s*:\s*{`)
	RegConfigHead      = regexp.MustCompile(`^\s*{\s*"config"\s*:\s*{`)
	RegCommentHead     = regexp.MustCompile(`^\s*{\s*"comments"\s*:\s*"`)
)

Functions

func Unmarshal

func Unmarshal(b []byte) (*nginx.Config, error)

Unmarshal, json反序列化并返回nginx配置对象的函数.

Types

type BasicContext

type BasicContext struct {
	Name     string             `json:"-"`
	Value    string             `json:"value,omitempty"`
	Children []*json.RawMessage `json:"param,omitempty"`
}

BasicContext, 用于json反序列化的上下文基础对象,定义了上下文类型的基本属性及基础方法.

type Comment

type Comment struct {
	nginx.Comment
}

func (*Comment) UnmarshalToJSON

func (c *Comment) UnmarshalToJSON(b []byte, _ *nginx.Caches) (nginx.Parser, error)

type Config

type Config struct {
	BasicContext `json:"config"`
}

func (*Config) UnmarshalToJSON

func (conf *Config) UnmarshalToJSON(b []byte, caches *nginx.Caches) (nginx.Parser, error)

type Events

type Events struct {
	BasicContext `json:"events"`
}

func (*Events) UnmarshalToJSON

func (e *Events) UnmarshalToJSON(b []byte, caches *nginx.Caches) (nginx.Parser, error)

type Geo

type Geo struct {
	BasicContext `json:"geo"`
}

func (*Geo) UnmarshalToJSON

func (g *Geo) UnmarshalToJSON(b []byte, caches *nginx.Caches) (nginx.Parser, error)

type Http

type Http struct {
	BasicContext `json:"http"`
}

func (*Http) UnmarshalToJSON

func (h *Http) UnmarshalToJSON(b []byte, caches *nginx.Caches) (nginx.Parser, error)

type If

type If struct {
	BasicContext `json:"if"`
}

func (*If) UnmarshalToJSON

func (i *If) UnmarshalToJSON(b []byte, caches *nginx.Caches) (nginx.Parser, error)

type Include

type Include struct {
	BasicContext `json:"include"`
	Key          *Key     `json:"tags"`
	Comment      *Comment `json:"comments"`
	ConfPWD      string   `json:"conf_pwd"`
}

func (*Include) UnmarshalToJSON

func (i *Include) UnmarshalToJSON(b []byte, caches *nginx.Caches) (nginx.Parser, error)

type Key

type Key struct {
	nginx.Key
}

func (*Key) UnmarshalToJSON

func (k *Key) UnmarshalToJSON(b []byte, _ *nginx.Caches) (nginx.Parser, error)

type LimitExcept

type LimitExcept struct {
	BasicContext `json:"limit_except"`
}

func (*LimitExcept) UnmarshalToJSON

func (le *LimitExcept) UnmarshalToJSON(b []byte, caches *nginx.Caches) (nginx.Parser, error)

type Location

type Location struct {
	BasicContext `json:"location"`
}

func (*Location) UnmarshalToJSON

func (l *Location) UnmarshalToJSON(b []byte, caches *nginx.Caches) (nginx.Parser, error)

type Map

type Map struct {
	BasicContext `json:"map"`
}

func (*Map) UnmarshalToJSON

func (m *Map) UnmarshalToJSON(b []byte, caches *nginx.Caches) (nginx.Parser, error)

type Server

type Server struct {
	BasicContext `json:"server"`
}

func (*Server) UnmarshalToJSON

func (s *Server) UnmarshalToJSON(b []byte, caches *nginx.Caches) (nginx.Parser, error)

type Stream

type Stream struct {
	BasicContext `json:"stream"`
}

func (*Stream) UnmarshalToJSON

func (st *Stream) UnmarshalToJSON(b []byte, caches *nginx.Caches) (nginx.Parser, error)

type Types

type Types struct {
	BasicContext `json:"types"`
}

func (*Types) UnmarshalToJSON

func (t *Types) UnmarshalToJSON(b []byte, caches *nginx.Caches) (nginx.Parser, error)

type Upstream

type Upstream struct {
	BasicContext `json:"upstream"`
}

func (*Upstream) UnmarshalToJSON

func (u *Upstream) UnmarshalToJSON(b []byte, caches *nginx.Caches) (nginx.Parser, error)

Jump to

Keyboard shortcuts

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