NCloud SDK for Go
Welcome to the NCloud SDK for Go! This SDK provides a convenient way to interact with the NCloud API using the Go programming language.
Table of Contents
Features
- Simplified integration with NCloud services
- Lightweight and easy-to-use SDK
- Fully compatible with the Go programming language
Installation
To install the NCloud SDK for Go, use the following go get command:
go get parkjunwoo.com/ncloud-sdk-go
Ensure that you have Go installed on your system. If not, download and install it from golang.org.
Getting Started
Follow these steps to get started with the NCloud SDK for Go:
-
Import the SDK in your Go application:
import "parkjunwoo.com/ncloud-sdk-go"
-
Initialize the SDK by providing your NCloud credentials:
config := ncloud.Config{
AccessKey: "your-access-key",
SecretKey: "your-secret-key",
}
client := ncloud.NewClient(config)
-
Start using the SDK to interact with NCloud services:
result, err := client.SomeService.SomeAction()
if err != nil {
log.Fatalf("Error: %v", err)
}
fmt.Println(result)
Examples
Example: Using GlobalDNS
package main
import (
"fmt"
"log"
"parkjunwoo.com/ncloud-sdk-go/services"
"parkjunwoo.com/ncloud-sdk-go/services/Networking/GlobalDNS"
)
func main() {
access := &services.Access{
AccessKey: "your-access-key",
SecretKey: "your-secret-key",
}
domainName := "example.com"
domain, err := GlobalDNS.GetDomain(access, domainName, true)
if err != nil {
log.Fatalf("Failed to get or create domain: %v", err)
}
fmt.Printf("Domain: %v\n", domain)
recordType := "A"
recordContent := "192.0.2.1"
recordTtl := 300
domain, record, err := GlobalDNS.SetRecord(access, domainName, recordType, recordContent, recordTtl, true)
if err != nil {
log.Fatalf("Failed to set record: %v", err)
}
fmt.Printf("Record: %v\n", record)
}
Documentation
For detailed API documentation and usage instructions, please refer to the official documentation.
Contributing
We welcome contributions to improve this SDK! To contribute:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Commit your changes with clear and descriptive messages.
- Open a pull request to the
main branch of this repository.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Thank you for using the NCloud SDK for Go! If you encounter any issues or have questions, feel free to open an issue in this repository.