8000 GitHub - oylmz/mopinion: Go library for accessing the Mopinion API https://developer.mopinion.com/api/ · GitHub
[go: up one dir, main page]

Skip to content
oylmzPublic

About

Go library for accessing the Mopinion API https://developer.mopinion.com/api/

Resources

Stars

4 stars

Watchers

2 watching

Forks

Repository files navigation

mopinion

Build Status codecov

Go client library for mopinion. The aim is to make the communication easier with the Mopinion API. Go doc can be found at https://godoc.org/github.com/oylmz/mopinion

Usage

package main

import (
	"context"
	"log"
	"os"

	"github.com/oylmz/mopinion"
)

func main() {
	basicCredentialProvider := mopinion.NewBasicCredentialProvider(os.Getenv("MOPINION_PUBLIC_KEY"),
		os.Getenv("MOPINION_PRIVATE_KEY"))
	client, _ := mopinion.NewClient(nil, basicCredentialProvider)

	ctx := context.TODO()
	var err error
	if _, _, err = client.Token.Get(ctx); err != nil {
		log.Fatalf("get the token: %s", err)
	}

	account, _, err := client.Account.Get(ctx)
	if err != nil {
		log.Fatalf("get account: %s", err)
	}

	log.Println("account: %+v", account)
}

Contributing

Please feel free to contribute if any updates or changes happen in the Mopinion API.

License

This library is distributed under the BSD-style license found in the LICENSE file.

About

Go library for accessing the Mopinion API https://developer.mopinion.com/api/

Resources

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0