From 3d1b8d231df7766bcb7bfe0e1233705224f3f926 Mon Sep 17 00:00:00 2001 From: ZueffC Date: Sat, 19 Jul 2025 21:59:42 +0300 Subject: [PATCH] Added normal README.md for project --- README.md | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 92 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6b21bce..911cf44 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,93 @@ -# dns-manager +# DNS Manager Library -Extensible DNS management library. \ No newline at end of file +The `dns_manager` library provides a standard interface for managing DNS records, enabling seamless integration with third-party libraries and drivers. This library simplifies the process of adding, deleting, updating, and retrieving DNS records. + +## Features + +- **Record Types**: Supports various DNS record types including A, AAAA, MX, CNAME, TXT, and a placeholder for non-essential records. +- **Record Management**: Provides an interface for performing actions on DNS records. +- **Flexible Integration**: Designed to work with any third-party DNS management system through a standard interface. + +## Installation + +To use the `dns_manager` library, simply include it in your Go project: + +```go +import "git.jolbec.icu/OxFF/dns-manager" +``` + +## Usage + +### Record Types + +The library defines several DNS record types: + +```go +const ( + None RecordType = "None essential" + A RecordType = "A" + AAAA RecordType = "AAAA" + MX RecordType = "MX" + CNAME RecordType = "CNAME" + TXT RecordType = "TXT" +) +``` + +### Record Structure + +A DNS record is represented by the `Record` struct: + +```go +type Record struct { + Type RecordType `json:"type,omitempty"` + Name string `json:"name,omitempty"` + Content string `json:"content,omitempty"` + TTL uint `json:"ttl,omitempty"` +} +``` + +### Actions Interface + +The `Actions` interface defines methods for managing DNS records: + +```go +type Actions interface { + AddRecord(*Record) (*Response, error) + DeleteRecord(*Record) (*Response, error) + UpdateRecord(*Record) (*Response, error) + GetRecords() ([]*Record, error) +} +``` + +### Creating a New Manager + +To create a new DNS manager, implement the `manager` interface and use the `New` function: + +```go +func New(manager_config manager) (Actions, error) { + return manager_config.New() +} +``` + +### Response Structure + +The `Response` struct is used to handle responses from DNS operations: + +```go +type Response struct { + Error string `json:"error"` + Message string `json:"message"` +} +``` + +## License + +This library is open-source and available under the MIT License. + +## Contributing + +Contributions are welcome! Please submit a pull request or open an issue for any enhancements or bug fixes. + +## Contact + +For questions or feedback, please reach out to the maintainer (OxFF). \ No newline at end of file