Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Migadu API in Go

GoDoc Go Report Card

migadu-go is a Go library for interfacing with the Migadu API.

Installing

go get github.com/MrLemur/migadu-go

Usage

See the pkg.go.dev documentation for full API reference.

Create a client with your admin email and API key (generate one here):

package main

import (
    "context"
    "fmt"
    "os"

    "github.com/MrLemur/migadu-go"
)

func main() {
    client, err := migadu.New("admin@example.com", "api_key")
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }

    ctx := context.Background()

    domain, err := client.NewDomain(ctx, &migadu.Domain{Name: "example.com"})
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }

    mailboxes, err := client.ListMailboxes(ctx, domain)
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }

    fmt.Println(mailboxes)
}

All methods accept a context.Context as the first argument and return an error if the operation fails.

About

Go library for interfacing with the Migadu API

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages