Documentation ¶
Index ¶
- Constants
- func IsRepeatKey(key string) bool
- type Block
- func (b *Block) FindDirectives(directiveName string) []IDirective
- func (b *Block) GetCodeBlock() string
- func (b *Block) GetComment() string
- func (b *Block) GetDirectives() []IDirective
- func (b *Block) GetLine() int
- func (b *Block) RemoveDirective(key string, params []string)
- func (b *Block) UpdateDirective(key string, params []string)
- type Comment
- type Config
- type Directive
- type Http
- func (h *Http) FindDirectives(directiveName string) []IDirective
- func (h *Http) GetBlock() IBlock
- func (h *Http) GetCodeBlock() string
- func (h *Http) GetComment() string
- func (h *Http) GetDirectives() []IDirective
- func (h *Http) GetLine() int
- func (h *Http) GetName() string
- func (h *Http) GetParameters() []string
- func (h *Http) RemoveDirective(key string, params []string)
- func (h *Http) UpdateDirective(key string, params []string)
- type IBlock
- type IDirective
- type Location
- func (l *Location) AddCache(cacheTime int, cacheUint string)
- func (l *Location) AddSubFilter(subFilters map[string]string)
- func (l *Location) ChangePath(Modifier string, Match string)
- func (l *Location) FindDirectives(directiveName string) []IDirective
- func (l *Location) GetBlock() IBlock
- func (l *Location) GetCodeBlock() string
- func (l *Location) GetComment() string
- func (l *Location) GetDirectives() []IDirective
- func (l *Location) GetLine() int
- func (l *Location) GetName() string
- func (l *Location) GetParameters() []string
- func (l *Location) RemoveCache()
- func (l *Location) RemoveDirective(key string, params []string)
- func (l *Location) RemoveSubFilter()
- func (l *Location) UpdateDirective(key string, params []string)
- type LuaBlock
- func (lb *LuaBlock) FindDirectives(directiveName string) []IDirective
- func (lb *LuaBlock) GetBlock() IBlock
- func (lb *LuaBlock) GetCodeBlock() string
- func (lb *LuaBlock) GetComment() string
- func (lb *LuaBlock) GetDirectives() []IDirective
- func (lb *LuaBlock) GetLine() int
- func (lb *LuaBlock) GetName() string
- func (lb *LuaBlock) GetParameters() []string
- func (lb *LuaBlock) RemoveDirective(key string, params []string)
- func (lb *LuaBlock) UpdateDirective(key string, params []string)
- type Server
- func (s *Server) AddHTTP2HTTPS()
- func (s *Server) AddListen(bind string, defaultServer bool, params ...string)
- func (s *Server) AddServerName(name string)
- func (s *Server) DeleteListen(bind string)
- func (s *Server) DeleteServerName(name string)
- func (s *Server) FindDirectives(directiveName string) []IDirective
- func (s *Server) GetBlock() IBlock
- func (s *Server) GetCodeBlock() string
- func (s *Server) GetComment() string
- func (s *Server) GetDirectives() []IDirective
- func (s *Server) GetLine() int
- func (s *Server) GetName() string
- func (s *Server) GetParameters() []string
- func (s *Server) RemoveDirective(key string, params []string)
- func (s *Server) RemoveListenByBind(bind string)
- func (s *Server) UpdateDirective(key string, params []string)
- func (s *Server) UpdateDirectiveBySecondKey(name string, key string, directive Directive)
- func (s *Server) UpdateListen(bind string, defaultServer bool, params ...string)
- func (s *Server) UpdatePHPProxy(proxy []string, localPath string)
- func (s *Server) UpdateRoot(path string)
- func (s *Server) UpdateRootLocation()
- func (s *Server) UpdateRootProxy(proxy []string)
- func (s *Server) UpdateServerName(names []string)
- type ServerListen
- func (sl *ServerListen) AddDefaultServer()
- func (sl *ServerListen) GetBlock() IBlock
- func (sl *ServerListen) GetComment() string
- func (sl *ServerListen) GetLine() int
- func (sl *ServerListen) GetName() string
- func (sl *ServerListen) GetParameters() []string
- func (sl *ServerListen) RemoveDefaultServe()
- type Upstream
- func (us *Upstream) AddServer(server *UpstreamServer)
- func (us *Upstream) FindDirectives(directiveName string) []IDirective
- func (us *Upstream) GetBlock() IBlock
- func (us *Upstream) GetCodeBlock() string
- func (us *Upstream) GetComment() string
- func (us *Upstream) GetDirectives() []IDirective
- func (us *Upstream) GetLine() int
- func (us *Upstream) GetName() string
- func (us *Upstream) GetParameters() []string
- func (us *Upstream) RemoveDirective(key string, params []string)
- func (us *Upstream) UpdateDirective(key string, params []string)
- type UpstreamServer
Constants ¶
View Source
const DefaultServer = "default_server"
Variables ¶
This section is empty.
Functions ¶
func IsRepeatKey ¶
Types ¶
type Block ¶
type Block struct { Line int Comment string Directives []IDirective IsLuaBlock bool LiteralCode string }
func (*Block) FindDirectives ¶
func (b *Block) FindDirectives(directiveName string) []IDirective
func (*Block) GetCodeBlock ¶
func (*Block) GetComment ¶
func (*Block) GetDirectives ¶
func (b *Block) GetDirectives() []IDirective
func (*Block) RemoveDirective ¶
func (*Block) UpdateDirective ¶
type Config ¶
func (*Config) FindServers ¶
type Http ¶
type Http struct { Comment string Servers []*Server Directives []IDirective Line int }
func NewHttp ¶
func NewHttp(directive IDirective) (*Http, error)
func (*Http) FindDirectives ¶
func (h *Http) FindDirectives(directiveName string) []IDirective
func (*Http) GetCodeBlock ¶
func (*Http) GetComment ¶
func (*Http) GetDirectives ¶
func (h *Http) GetDirectives() []IDirective
func (*Http) GetParameters ¶
func (*Http) RemoveDirective ¶
func (*Http) UpdateDirective ¶
type IBlock ¶
type IBlock interface { GetDirectives() []IDirective FindDirectives(directiveName string) []IDirective RemoveDirective(name string, params []string) UpdateDirective(name string, params []string) GetComment() string GetLine() int GetCodeBlock() string }
type IDirective ¶
type Location ¶
type Location struct { Modifier string Match string Cache bool ProxyPass string Host string CacheTime int CacheUint string Comment string Directives []IDirective Line int Parameters []string Replaces map[string]string }
func NewLocation ¶
func NewLocation(directive IDirective) *Location
func (*Location) AddSubFilter ¶ added in v1.2.0
func (*Location) ChangePath ¶ added in v1.2.0
func (*Location) FindDirectives ¶ added in v1.2.0
func (l *Location) FindDirectives(directiveName string) []IDirective
func (*Location) GetCodeBlock ¶
func (*Location) GetComment ¶ added in v1.2.0
func (*Location) GetDirectives ¶ added in v1.2.0
func (l *Location) GetDirectives() []IDirective
func (*Location) GetParameters ¶ added in v1.2.0
func (*Location) RemoveCache ¶ added in v1.2.0
func (l *Location) RemoveCache()
func (*Location) RemoveDirective ¶ added in v1.2.0
func (*Location) RemoveSubFilter ¶ added in v1.2.0
func (l *Location) RemoveSubFilter()
func (*Location) UpdateDirective ¶ added in v1.2.0
type LuaBlock ¶
type LuaBlock struct { Directives []IDirective Name string Comment string LuaCode string Line int }
func NewLuaBlock ¶
func NewLuaBlock(directive IDirective) (*LuaBlock, error)
func (*LuaBlock) FindDirectives ¶
func (lb *LuaBlock) FindDirectives(directiveName string) []IDirective
func (*LuaBlock) GetCodeBlock ¶
func (*LuaBlock) GetComment ¶
func (*LuaBlock) GetDirectives ¶
func (lb *LuaBlock) GetDirectives() []IDirective
func (*LuaBlock) GetParameters ¶
func (*LuaBlock) RemoveDirective ¶
func (*LuaBlock) UpdateDirective ¶
type Server ¶
type Server struct { Comment string Listens []*ServerListen Directives []IDirective Line int }
func NewServer ¶
func NewServer(directive IDirective) (*Server, error)
func (*Server) AddHTTP2HTTPS ¶
func (s *Server) AddHTTP2HTTPS()
func (*Server) AddServerName ¶
func (*Server) DeleteListen ¶
func (*Server) DeleteServerName ¶
func (*Server) FindDirectives ¶
func (s *Server) FindDirectives(directiveName string) []IDirective
func (*Server) GetCodeBlock ¶
func (*Server) GetComment ¶
func (*Server) GetDirectives ¶
func (s *Server) GetDirectives() []IDirective
func (*Server) GetParameters ¶
func (*Server) RemoveDirective ¶
func (*Server) RemoveListenByBind ¶
func (*Server) UpdateDirective ¶
func (*Server) UpdateDirectiveBySecondKey ¶
func (*Server) UpdateListen ¶
func (*Server) UpdatePHPProxy ¶ added in v1.1.0
func (*Server) UpdateRoot ¶
func (*Server) UpdateRootLocation ¶
func (s *Server) UpdateRootLocation()
func (*Server) UpdateRootProxy ¶
func (*Server) UpdateServerName ¶
type ServerListen ¶
type ServerListen struct { Bind string DefaultServer string Parameters []string Comment string Line int }
func NewServerListen ¶
func NewServerListen(params []string, line int) *ServerListen
func (*ServerListen) AddDefaultServer ¶
func (sl *ServerListen) AddDefaultServer()
func (*ServerListen) GetBlock ¶
func (sl *ServerListen) GetBlock() IBlock
func (*ServerListen) GetComment ¶
func (sl *ServerListen) GetComment() string
func (*ServerListen) GetLine ¶
func (sl *ServerListen) GetLine() int
func (*ServerListen) GetName ¶
func (sl *ServerListen) GetName() string
func (*ServerListen) GetParameters ¶
func (sl *ServerListen) GetParameters() []string
func (*ServerListen) RemoveDefaultServe ¶
func (sl *ServerListen) RemoveDefaultServe()
type Upstream ¶
type Upstream struct { UpstreamName string UpstreamServers []*UpstreamServer Directives []IDirective Comment string Line int }
func NewUpstream ¶
func NewUpstream(directive IDirective) (*Upstream, error)
func (*Upstream) AddServer ¶
func (us *Upstream) AddServer(server *UpstreamServer)
func (*Upstream) FindDirectives ¶
func (us *Upstream) FindDirectives(directiveName string) []IDirective
func (*Upstream) GetCodeBlock ¶
func (*Upstream) GetComment ¶
func (*Upstream) GetDirectives ¶
func (us *Upstream) GetDirectives() []IDirective
func (*Upstream) GetParameters ¶
func (*Upstream) RemoveDirective ¶
func (*Upstream) UpdateDirective ¶
type UpstreamServer ¶
type UpstreamServer struct { Comment string Address string Flags []string Parameters map[string]string Line int }
func NewUpstreamServer ¶
func NewUpstreamServer(directive IDirective) *UpstreamServer
func (*UpstreamServer) GetBlock ¶
func (uss *UpstreamServer) GetBlock() IBlock
func (*UpstreamServer) GetComment ¶
func (uss *UpstreamServer) GetComment() string
func (*UpstreamServer) GetDirective ¶
func (uss *UpstreamServer) GetDirective() *Directive
func (*UpstreamServer) GetLine ¶
func (uss *UpstreamServer) GetLine() int
func (*UpstreamServer) GetName ¶
func (uss *UpstreamServer) GetName() string
func (*UpstreamServer) GetParameters ¶
func (uss *UpstreamServer) GetParameters() []string
Click to show internal directories.
Click to hide internal directories.