Documentation ¶
Index ¶
- Variables
- type Block
- func (b *Block) AddDirective(directive Directive, begining bool, endWithNewLine bool)
- func (b *Block) DeleteDirective(directive Directive)
- func (b *Block) DeleteDirectiveByName(directiveName string)
- func (b *Block) Dump() string
- func (b *Block) FindBlocks(blockName string) []Block
- func (b *Block) FindComments() []Comment
- func (b *Block) FindDirectives(directiveName string) []Directive
- func (b *Block) GetName() string
- func (b *Block) GetParameters() []string
- func (b *Block) SetComments(comments []string)
- func (b *Block) SetParameters(parameters []string)
- type Comment
- type CommentPosition
- type Config
- func (c *Config) AddConfigFile(filePath string) (*ConfigFile, error)
- func (c *Config) Dump() error
- func (c *Config) FindBlocks(blockName string) []Block
- func (c *Config) FindDirectives(directiveName string) []Directive
- func (c *Config) FindHttpBlocks() []HttpBlock
- func (c *Config) FindLocationBlocks() []LocationBlock
- func (c *Config) FindServerBlocks() []ServerBlock
- func (c *Config) FindServerBlocksByServerName(serverName string) []ServerBlock
- func (c *Config) FindUpstreamBlocks() []UpstreamBlock
- func (c *Config) FindUpstreamBlocksByName(upstreamName string) []UpstreamBlock
- func (c *Config) GetConfigFile(configFileName string) *ConfigFile
- func (c *Config) ParseFile(filePath string) error
- type ConfigFile
- func (c *ConfigFile) AddDirective(directive Directive, begining bool, endWithNewLine bool)
- func (c *ConfigFile) AddHttpBlock() HttpBlock
- func (c *ConfigFile) DeleteDirective(directive Directive)
- func (c *ConfigFile) DeleteDirectiveByName(directiveName string)
- func (c *ConfigFile) DeleteHttpBlock(httpBlock HttpBlock)
- func (c *ConfigFile) DeleteServerBlock(serverBlock ServerBlock)
- func (c *ConfigFile) DeleteUpstreamBlock(upstreamBlock ServerBlock)
- func (c *ConfigFile) Dump() error
- func (c *ConfigFile) FindBlocks(blockName string) []Block
- func (c *ConfigFile) FindDirectives(directiveName string) []Directive
- func (c *ConfigFile) FindHttpBlocks() []HttpBlock
- func (c *ConfigFile) FindLocationBlocks() []LocationBlock
- func (c *ConfigFile) FindServerBlocks() []ServerBlock
- func (c *ConfigFile) FindServerBlocksByServerName(serverName string) []ServerBlock
- func (c *ConfigFile) FindUpstreamBlocks() []UpstreamBlock
- func (c *ConfigFile) FindUpstreamBlocksByName(upstreamName string) []UpstreamBlock
- type Directive
- func (d *Directive) AddValue(expression string)
- func (d *Directive) FindComments() []Comment
- func (d *Directive) GetFirstValue() string
- func (d *Directive) GetName() string
- func (d *Directive) GetValues() []string
- func (d *Directive) SetComments(comments []string)
- func (d *Directive) SetValue(expression string)
- func (d *Directive) SetValues(expressions []string)
- type HttpBlock
- func (b *HttpBlock) AddServerBlock() ServerBlock
- func (b *HttpBlock) AddUpstreamBlock(upstreamName string, begining bool) UpstreamBlock
- func (b *HttpBlock) DeleteServerBlock(serverBlock ServerBlock)
- func (b *HttpBlock) DeleteUpstreamBlock(upsstreamBlock UpstreamBlock)
- func (b *HttpBlock) FindBlocks(blockName string) []Block
- func (b *HttpBlock) FindLocationBlocks() []LocationBlock
- func (b *HttpBlock) FindServerBlocks() []ServerBlock
- func (b *HttpBlock) FindServerBlocksByServerName(serverName string) []ServerBlock
- func (b *HttpBlock) FindUpstreamBlocks() []UpstreamBlock
- func (b *HttpBlock) FindUpstreamBlocksByName(upstreamName string) []UpstreamBlock
- type Listen
- type LocationBlock
- func (l *LocationBlock) AddLocationBlock(modifier, match string, begining bool) LocationBlock
- func (l *LocationBlock) DeleteLocationBlock(locationBlock LocationBlock)
- func (l *LocationBlock) GetLocationMatch() string
- func (l *LocationBlock) GetModifier() string
- func (l *LocationBlock) SetLocationMatch(match string)
- func (l *LocationBlock) SetModifier(modifier string)
- type ServerAddress
- func (a ServerAddress) GetAddressWithNewPort(port string) ServerAddress
- func (a ServerAddress) GetHash() string
- func (a ServerAddress) GetNormalizedHost() string
- func (a ServerAddress) GetNormalizedIpv6() string
- func (a ServerAddress) IsEqual(b ServerAddress) bool
- func (a ServerAddress) IsWildcardPort() bool
- func (a ServerAddress) ToString() string
- type ServerBlock
- func (s *ServerBlock) AddLocationBlock(modifier, match string, begining bool) LocationBlock
- func (s *ServerBlock) DeleteLocationBlock(locationBlock LocationBlock)
- func (s *ServerBlock) FindLocationBlocks() []LocationBlock
- func (s *ServerBlock) GetAddresses() []ServerAddress
- func (s *ServerBlock) GetDocumentRoot() string
- func (s *ServerBlock) GetListens() []Listen
- func (s *ServerBlock) GetServerNames() []string
- func (s *ServerBlock) HasSSL() bool
- func (s *ServerBlock) IsIpv4Enabled() bool
- func (s *ServerBlock) IsIpv6Enabled() bool
- type UpstreamBlock
- func (b *UpstreamBlock) AddServer(upstreamServer UpstreamServer)
- func (b *UpstreamBlock) DeleteServer(upstreamServer UpstreamServer)
- func (b *UpstreamBlock) GetServers() []UpstreamServer
- func (b *UpstreamBlock) GetUpstreamName() string
- func (b *UpstreamBlock) SetServers(upstreamServers []UpstreamServer)
- func (b *UpstreamBlock) SetUpstreamName(name string)
- type UpstreamServer
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidDirective = errors.New("entry is not a directive")
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { FilePath string // contains filtered or unexported fields }
func (*Block) AddDirective ¶
func (*Block) DeleteDirective ¶
func (*Block) DeleteDirectiveByName ¶
func (*Block) FindBlocks ¶
func (*Block) FindComments ¶
func (*Block) FindDirectives ¶
func (*Block) GetParameters ¶
func (*Block) SetComments ¶
func (*Block) SetParameters ¶
type Comment ¶
type Comment struct { Content string Position CommentPosition // contains filtered or unexported fields }
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func (*Config) AddConfigFile ¶
func (c *Config) AddConfigFile(filePath string) (*ConfigFile, error)
func (*Config) FindBlocks ¶
func (*Config) FindDirectives ¶
func (*Config) FindHttpBlocks ¶
func (*Config) FindLocationBlocks ¶
func (c *Config) FindLocationBlocks() []LocationBlock
func (*Config) FindServerBlocks ¶
func (c *Config) FindServerBlocks() []ServerBlock
func (*Config) FindServerBlocksByServerName ¶
func (c *Config) FindServerBlocksByServerName(serverName string) []ServerBlock
func (*Config) FindUpstreamBlocks ¶
func (c *Config) FindUpstreamBlocks() []UpstreamBlock
func (*Config) FindUpstreamBlocksByName ¶
func (c *Config) FindUpstreamBlocksByName(upstreamName string) []UpstreamBlock
func (*Config) GetConfigFile ¶
func (c *Config) GetConfigFile(configFileName string) *ConfigFile
type ConfigFile ¶
type ConfigFile struct { FilePath string // contains filtered or unexported fields }
func (*ConfigFile) AddDirective ¶
func (c *ConfigFile) AddDirective(directive Directive, begining bool, endWithNewLine bool)
func (*ConfigFile) AddHttpBlock ¶
func (c *ConfigFile) AddHttpBlock() HttpBlock
func (*ConfigFile) DeleteDirective ¶
func (c *ConfigFile) DeleteDirective(directive Directive)
func (*ConfigFile) DeleteDirectiveByName ¶
func (c *ConfigFile) DeleteDirectiveByName(directiveName string)
func (*ConfigFile) DeleteHttpBlock ¶
func (c *ConfigFile) DeleteHttpBlock(httpBlock HttpBlock)
func (*ConfigFile) DeleteServerBlock ¶
func (c *ConfigFile) DeleteServerBlock(serverBlock ServerBlock)
func (*ConfigFile) DeleteUpstreamBlock ¶
func (c *ConfigFile) DeleteUpstreamBlock(upstreamBlock ServerBlock)
func (*ConfigFile) Dump ¶
func (c *ConfigFile) Dump() error
func (*ConfigFile) FindBlocks ¶
func (c *ConfigFile) FindBlocks(blockName string) []Block
func (*ConfigFile) FindDirectives ¶
func (c *ConfigFile) FindDirectives(directiveName string) []Directive
func (*ConfigFile) FindHttpBlocks ¶
func (c *ConfigFile) FindHttpBlocks() []HttpBlock
func (*ConfigFile) FindLocationBlocks ¶
func (c *ConfigFile) FindLocationBlocks() []LocationBlock
func (*ConfigFile) FindServerBlocks ¶
func (c *ConfigFile) FindServerBlocks() []ServerBlock
func (*ConfigFile) FindServerBlocksByServerName ¶
func (c *ConfigFile) FindServerBlocksByServerName(serverName string) []ServerBlock
func (*ConfigFile) FindUpstreamBlocks ¶
func (c *ConfigFile) FindUpstreamBlocks() []UpstreamBlock
func (*ConfigFile) FindUpstreamBlocksByName ¶
func (c *ConfigFile) FindUpstreamBlocksByName(upstreamName string) []UpstreamBlock
type Directive ¶
type Directive struct {
// contains filtered or unexported fields
}
func NewDirective ¶
func (*Directive) FindComments ¶
func (*Directive) GetFirstValue ¶
func (*Directive) SetComments ¶
type HttpBlock ¶
type HttpBlock struct {
Block
}
func (*HttpBlock) AddServerBlock ¶
func (b *HttpBlock) AddServerBlock() ServerBlock
func (*HttpBlock) AddUpstreamBlock ¶
func (b *HttpBlock) AddUpstreamBlock(upstreamName string, begining bool) UpstreamBlock
func (*HttpBlock) DeleteServerBlock ¶
func (b *HttpBlock) DeleteServerBlock(serverBlock ServerBlock)
func (*HttpBlock) DeleteUpstreamBlock ¶
func (b *HttpBlock) DeleteUpstreamBlock(upsstreamBlock UpstreamBlock)
func (*HttpBlock) FindBlocks ¶
func (*HttpBlock) FindLocationBlocks ¶
func (b *HttpBlock) FindLocationBlocks() []LocationBlock
func (*HttpBlock) FindServerBlocks ¶
func (b *HttpBlock) FindServerBlocks() []ServerBlock
func (*HttpBlock) FindServerBlocksByServerName ¶
func (b *HttpBlock) FindServerBlocksByServerName(serverName string) []ServerBlock
func (*HttpBlock) FindUpstreamBlocks ¶
func (b *HttpBlock) FindUpstreamBlocks() []UpstreamBlock
func (*HttpBlock) FindUpstreamBlocksByName ¶
func (b *HttpBlock) FindUpstreamBlocksByName(upstreamName string) []UpstreamBlock
type LocationBlock ¶
type LocationBlock struct {
Block
}
func (*LocationBlock) AddLocationBlock ¶
func (l *LocationBlock) AddLocationBlock(modifier, match string, begining bool) LocationBlock
func (*LocationBlock) DeleteLocationBlock ¶
func (l *LocationBlock) DeleteLocationBlock(locationBlock LocationBlock)
func (*LocationBlock) GetLocationMatch ¶
func (l *LocationBlock) GetLocationMatch() string
func (*LocationBlock) GetModifier ¶
func (l *LocationBlock) GetModifier() string
func (*LocationBlock) SetLocationMatch ¶
func (l *LocationBlock) SetLocationMatch(match string)
func (*LocationBlock) SetModifier ¶
func (l *LocationBlock) SetModifier(modifier string)
type ServerAddress ¶
func CreateServerAddressFromString ¶
func CreateServerAddressFromString(addrStr string) ServerAddress
CreateServerAddressFromString parses address string and returns Address structure
func (ServerAddress) GetAddressWithNewPort ¶
func (a ServerAddress) GetAddressWithNewPort(port string) ServerAddress
GetAddressWithNewPort returns new a ServerAddress instance with changed port
func (ServerAddress) GetHash ¶
func (a ServerAddress) GetHash() string
GetHash returns addr hash based on host an port
func (ServerAddress) GetNormalizedHost ¶
func (a ServerAddress) GetNormalizedHost() string
GetNormalizedHost returns normalized host. Normalization occurres only for ipv6 address. Ipv4 returns as is. For example: [fd00:dead:beaf::1] -> fd00:dead:beaf:0:0:0:0:1
func (ServerAddress) GetNormalizedIpv6 ¶
func (a ServerAddress) GetNormalizedIpv6() string
GetNormalizedIpv6 returns normalized IPv6 For example: [fd00:dead:beaf::1] -> fd00:dead:beaf:0:0:0:0:1
func (ServerAddress) IsEqual ¶
func (a ServerAddress) IsEqual(b ServerAddress) bool
func (ServerAddress) IsWildcardPort ¶
func (a ServerAddress) IsWildcardPort() bool
func (ServerAddress) ToString ¶
func (a ServerAddress) ToString() string
type ServerBlock ¶
type ServerBlock struct {
Block
}
func (*ServerBlock) AddLocationBlock ¶
func (s *ServerBlock) AddLocationBlock(modifier, match string, begining bool) LocationBlock
func (*ServerBlock) DeleteLocationBlock ¶
func (s *ServerBlock) DeleteLocationBlock(locationBlock LocationBlock)
func (*ServerBlock) FindLocationBlocks ¶
func (s *ServerBlock) FindLocationBlocks() []LocationBlock
func (*ServerBlock) GetAddresses ¶
func (s *ServerBlock) GetAddresses() []ServerAddress
func (*ServerBlock) GetDocumentRoot ¶
func (s *ServerBlock) GetDocumentRoot() string
func (*ServerBlock) GetListens ¶
func (s *ServerBlock) GetListens() []Listen
func (*ServerBlock) GetServerNames ¶
func (s *ServerBlock) GetServerNames() []string
func (*ServerBlock) HasSSL ¶
func (s *ServerBlock) HasSSL() bool
func (*ServerBlock) IsIpv4Enabled ¶
func (s *ServerBlock) IsIpv4Enabled() bool
func (*ServerBlock) IsIpv6Enabled ¶
func (s *ServerBlock) IsIpv6Enabled() bool
type UpstreamBlock ¶
type UpstreamBlock struct {
Block
}
func (*UpstreamBlock) AddServer ¶
func (b *UpstreamBlock) AddServer(upstreamServer UpstreamServer)
func (*UpstreamBlock) DeleteServer ¶
func (b *UpstreamBlock) DeleteServer(upstreamServer UpstreamServer)
func (*UpstreamBlock) GetServers ¶
func (b *UpstreamBlock) GetServers() []UpstreamServer
func (*UpstreamBlock) GetUpstreamName ¶
func (b *UpstreamBlock) GetUpstreamName() string
func (*UpstreamBlock) SetServers ¶
func (b *UpstreamBlock) SetServers(upstreamServers []UpstreamServer)
func (*UpstreamBlock) SetUpstreamName ¶
func (b *UpstreamBlock) SetUpstreamName(name string)
type UpstreamServer ¶
type UpstreamServer struct {
Directive
}
func NewUpstreamServer ¶
func NewUpstreamServer(address string, flags []string) UpstreamServer
func (*UpstreamServer) GetAddress ¶
func (s *UpstreamServer) GetAddress() string
func (*UpstreamServer) GetFlags ¶
func (s *UpstreamServer) GetFlags() []string
func (*UpstreamServer) SetAddress ¶
func (s *UpstreamServer) SetAddress(address string)
func (*UpstreamServer) SetFlags ¶
func (s *UpstreamServer) SetFlags(flags []string)
Click to show internal directories.
Click to hide internal directories.