Documentation
¶
Overview ¶
Copyright 2020 CLOUD&HEAT Technologies GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Copyright 2020 CLOUD&HEAT Technologies GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Copyright 2020 CLOUD&HEAT Technologies GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- Variables
- type ApplyHandlerv1
- type ConfigGenerator
- type ConfigManager
- type KeepalivedConfigGenerator
- func (g *KeepalivedConfigGenerator) GenerateConfig(lb *model.LoadBalancer, out io.Writer) error
- func (g *KeepalivedConfigGenerator) GenerateStructuredConfig(lb *model.LoadBalancer) (*keepalivedConfig, error)
- func (g *KeepalivedConfigGenerator) WriteStructuredConfig(cfg *keepalivedConfig, out io.Writer) error
- type NftablesGenerator
- type SAddrMatch
Constants ¶
This section is empty.
Variables ¶
var (
ErrProtocolNotSupported = fmt.Errorf("Protocol is not supported")
)
Functions ¶
This section is empty.
Types ¶
type ApplyHandlerv1 ¶
type ApplyHandlerv1 struct { KeepalivedConfig *ConfigManager NftablesConfig *ConfigManager MaxRequestSize int64 // contains filtered or unexported fields }
func (*ApplyHandlerv1) ProcessRequest ¶
func (h *ApplyHandlerv1) ProcessRequest(lbcfg *model.LoadBalancer) (int, string)
func (*ApplyHandlerv1) ServeHTTP ¶
func (h *ApplyHandlerv1) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ConfigGenerator ¶
type ConfigGenerator interface {
GenerateConfig(lb *model.LoadBalancer, out io.Writer) error
}
type ConfigManager ¶
type ConfigManager struct { Generator ConfigGenerator Service config.ServiceConfig }
func (*ConfigManager) Check ¶
func (m *ConfigManager) Check() error
func (*ConfigManager) Fix ¶
func (m *ConfigManager) Fix() error
func (*ConfigManager) MakeBackup ¶
func (m *ConfigManager) MakeBackup() (string, error)
func (*ConfigManager) Reload ¶
func (m *ConfigManager) Reload() error
func (*ConfigManager) ReloadAndCheck ¶
func (m *ConfigManager) ReloadAndCheck() error
func (*ConfigManager) WriteWithRollback ¶
func (m *ConfigManager) WriteWithRollback(cfg *model.LoadBalancer) (bool, error)
type KeepalivedConfigGenerator ¶
type KeepalivedConfigGenerator struct { Priority int VRRPPassword string VRIDBase int Interface string }
func (*KeepalivedConfigGenerator) GenerateConfig ¶
func (g *KeepalivedConfigGenerator) GenerateConfig(lb *model.LoadBalancer, out io.Writer) error
func (*KeepalivedConfigGenerator) GenerateStructuredConfig ¶
func (g *KeepalivedConfigGenerator) GenerateStructuredConfig(lb *model.LoadBalancer) (*keepalivedConfig, error)
func (*KeepalivedConfigGenerator) WriteStructuredConfig ¶
func (g *KeepalivedConfigGenerator) WriteStructuredConfig(cfg *keepalivedConfig, out io.Writer) error
type NftablesGenerator ¶
func (*NftablesGenerator) GenerateConfig ¶
func (g *NftablesGenerator) GenerateConfig(m *model.LoadBalancer, out io.Writer) error
func (*NftablesGenerator) GenerateStructuredConfig ¶
func (g *NftablesGenerator) GenerateStructuredConfig(m *model.LoadBalancer) (*nftablesConfig, error)
Generates a config suitable for nftablesTemplate from a LoadBalancer model
func (*NftablesGenerator) WriteStructuredConfig ¶
func (g *NftablesGenerator) WriteStructuredConfig(cfg *nftablesConfig, out io.Writer) error
type SAddrMatch ¶ added in v0.5.0
type SAddrMatch struct { // String like eg. "ip saddr 0.0.0.0/0" ready to be used in an nftables rule. // May be "" so the rule doesn't match on source addresses (allow all) Match string // List of cidrs to block. If empty, set verdict to 'accept'. // If nonempty, set verdict to 'jump $c' and generate a new // chain $c that drops all address ranges and defaults to 'accept' Except []string }