Skip to content

Latest commit

 

History

History
82 lines (60 loc) · 1.54 KB

readme.md

File metadata and controls

82 lines (60 loc) · 1.54 KB

Go library for accessing the Mail-in-a-Box API

Build Status PkgGoDev Go Report Card

A Mail-in-a-Box API client written in Go.

mailinabox is a Go client library for accessing the Mail-in-a-Box API.

Examples

package main

import (
	"context"
	"fmt"

	"github.com/nrdcg/mailinabox"
)

func main() {
	client, err := mailinabox.NewClient("https://example.com", "user@example.com", "secret")
	if err != nil {
		panic(err)
	}

	record := mailinabox.Record{
		Name:  "example.com",
		Type:  "A",
		Value: "10.0.0.1",
	}

	resp, err := client.DNS.AddRecord(context.Background(), record)
	if err != nil {
		panic(err)
	}

	fmt.Println(resp)
}
package mailinabox_test

import (
	"context"
	"fmt"

	"github.com/nrdcg/mailinabox"
)

func main() {
	client, err := mailinabox.NewClient("https://example.com", "user@example.com", "secret")
	if err != nil {
		panic(err)
	}

	resp, err := client.System.Reboot(context.Background())
	if err != nil {
		panic(err)
	}

	fmt.Println(resp)
}

API Documentation

Supported APIs

  • User API
  • Mail API
  • DNS API
  • SSL API
  • Web API
  • MFA API
  • System API