Documentation ¶
Index ¶
- Constants
- func IsRepeatKey(key string) bool
- type Block
- type Comment
- type Config
- type Directive
- type Http
- func (h *Http) FindDirectives(directiveName string) []IDirective
- func (h *Http) GetBlock() IBlock
- 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
- 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) 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) 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) 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 }
func (*Block) FindDirectives ¶
func (b *Block) FindDirectives(directiveName string) []IDirective
func (*Block) GetComment ¶
func (*Block) GetDirectives ¶
func (b *Block) GetDirectives() []IDirective
func (*Block) RemoveDirective ¶
func (*Block) UpdateDirective ¶
type Config ¶
func (*Config) FindDirectives ¶
func (c *Config) FindDirectives(directiveName string) []IDirective
func (*Config) FindServers ¶
func (*Config) FindUpstreams ¶
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) 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 }
type IDirective ¶
type Location ¶
func NewLocation ¶
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) 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) 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) 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.