wunderdns

package
v0.0.0-...-59b0f35 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Copyright 2018-2020 Wargaming.Net

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.

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.

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.

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.

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.

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.

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.

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.

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.

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

Constants

View Source
const (
	LogFatal = iota
	LogError
	LogWarning
	LogInfo
	LogDebug
	LogTrace
)
View Source
const DomainNameAny string = "*"

Variables

This section is empty.

Functions

func EnableOrm

func EnableOrm()

func NewConfig

func NewConfig(configFile string)

func Run

func Run()

func SetLogLevel

func SetLogLevel(loglevel int)

Types

type AMQPConfig

type AMQPConfig struct {
	URL      string
	Exchange string
}

type AuthData

type AuthData struct {
	Token       string
	Secret      string
	Permissions []Permission
	Priority    int
	// contains filtered or unexported fields
}

type AuthDatabase

type AuthDatabase map[string]AuthData

type AuthHeader

type AuthHeader struct {
	Token string `json:"t"`
	Sum   string `json:"x"`
	// contains filtered or unexported fields
}

type Command

type Command string
const (
	CommandCreateDomain  Command = "create_domain"
	CommandCreateRecord  Command = "create_record"
	CommandDeleteRecord  Command = "delete_record"
	CommandReplaceRecord Command = "replace_record"
	CommandListRecords   Command = "list_records"
	CommandListOwn       Command = "list_own"
	CommandListDomains   Command = "list_domains"
	CommandSearchRecord  Command = "search_record"
	CommandReplaceOwner  Command = "replace_owner"
	CommandAny           Command = "*"
)

type Config

type Config struct {
	AMQPConfigs []*AMQPConfig
	PSQLConfigs []*PSQLConfig
	Auth        *AuthDatabase
	Vault       *VaultData
}

type Domain

type Domain struct {
	Name string     `json:"n"`
	View DomainView `json:"v"`
}

type DomainPretty

type DomainPretty struct {
	Name string     `json:"name"`
	View DomainView `json:"type"`
}

type DomainView

type DomainView string
const (
	DomainViewPublic  DomainView = "public"
	DomainViewPrivate DomainView = "private"
	DomainViewAny     DomainView = "*"
)

type Logging

type Logging struct {
	// contains filtered or unexported fields
}

func (*Logging) Debug

func (l *Logging) Debug(message ...interface{})

func (*Logging) Error

func (l *Logging) Error(message ...interface{})

func (*Logging) Fatal

func (l *Logging) Fatal(message ...interface{})

func (*Logging) Info

func (l *Logging) Info(message ...interface{})

func (*Logging) Trace

func (l *Logging) Trace(message ...interface{})

func (*Logging) Warning

func (l *Logging) Warning(message ...interface{})

type PSQLConfig

type PSQLConfig struct {
	Host     string
	Port     int
	Username string
	Password string
	Database string
	SSL      bool
	View     DomainView
}

type Permission

type Permission struct {
	Domain    Domain
	Permitted []Command
}

type Record

type Record struct {
	Name string     `json:"n"`
	Type RecordType `json:"t"`
	Data []string   `json:"d"`
	TTL  int        `json:"l"`
	// contains filtered or unexported fields
}

type RecordPretty

type RecordPretty struct {
	Name string     `json:"name"`
	Type RecordType `json:"type"`
	Data []string   `json:"data"`
	TTL  int        `json:"ttl"`
	// contains filtered or unexported fields
}

type RecordType

type RecordType string
const (
	RecordTypeA     RecordType = "A"
	RecordTypeAAAA  RecordType = "AAAA"
	RecordTypeCNAME RecordType = "CNAME"
	RecordTypeTXT   RecordType = "TXT"
	RecordTypeSRV   RecordType = "SRV"
	RecordTypeMX    RecordType = "MX"
	RecordTypeNS    RecordType = "NS"
	RecordTypePTR   RecordType = "PTR"
	RecordTypeSOA   RecordType = "SOA"
)

type RecordsApiTable

type RecordsApiTable struct {
	Id       uint   `gorm:"primaryKey"`
	DomainId uint   `gorm:"column:domain_id"`
	Name     string `gorm:"size:255;not null"`
	Type     string `gorm:"size:10;not null"`
	Content  string `gorm:"size:65535;not null"`
	Ttl      *int
	Prio     *int

	Disabled  *bool
	Ordername *string `gorm:"size:255"`
	Auth      *bool
	Owner     *string `gorm:"size:255"`
	// contains filtered or unexported fields
}

func (RecordsApiTable) TableName

func (RecordsApiTable) TableName() string

type RecordsTable

type RecordsTable struct {
	Id       uint   `gorm:"primaryKey"`
	DomainId uint   `gorm:"column:domain_id"`
	Name     string `gorm:"size:255;not null"`
	Type     string `gorm:"size:10;not null"`
	Content  string `gorm:"size:65535;not null"`
	Ttl      *int
	Prio     *int

	Disabled  *bool
	Ordername *string `gorm:"size:255"`
	Auth      *bool
	// contains filtered or unexported fields
}

func (RecordsTable) TableName

func (RecordsTable) TableName() string

type RecordsType

type RecordsType []*Record

type VaultData

type VaultData struct {
	Enabled bool
	URL     string
	Token   string
	TTL     time.Duration
}

type WunderReply

type WunderReply struct {
	Status string      `json:"status"`
	Data   interface{} `json:"data"`
}

func ReturnError

func ReturnError(err ...interface{}) *WunderReply

func ReturnSuccess

func ReturnSuccess(data interface{}) *WunderReply

type WunderRequest

type WunderRequest struct {
	Auth     *AuthHeader `json:"a"`
	Cmd      Command     `json:"c"`
	Domain   *Domain     `json:"d"`
	Record   []*Record   `json:"r"`
	NewToken string      `json:"n"`
	Pretty   bool        `json:"p"`
}

Jump to

Keyboard shortcuts

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