Giter Club home page Giter Club logo

omglol-client-go's Introduction

Tests GoDoc GitHub release (latest SemVer) GitHub go.mod Go version

omglol-client-go

API client library for omg.lol written in Go

Warning The omg.lol API is still in development, and endpoints are subject to change. This may cause the client to break unexpectedly.

Usage

To install this module:

go get github.com/ejstreet/omglol-client-go@latest

To import:

import (
  "github.com/ejstreet/omglol-client-go/omglol"
 )

Create a new client:

c, err := omglol.NewClient(email, api_key)

Use a method:

a, err := c.GetAccountInfo()

See test files for further examples.

Tests

To run tests, first export the following variables:

export OMGLOL_API_KEY=<your_api_key>
export OMGLOL_USER_EMAIL=<your_email>
export OMGLOL_USERNAME=<your_name>
export OMGLOL_TEST_OWNED_DOMAIN=<your_domain>

Then run from the root of the git repo:

go test ./... -v

Supported Features

This project is a work-in-progress, see the following table for supported features:

Resource Sub-Resource Method Supported
Account Info GET ✔️
Addresses GET ✔️
Name GET ✔️
POST ✔️
Sessions GET ✔️
DELETE ✔️
Settings GET ✔️
POST ✔️
Address Availability GET ✔️
Expiration GET ✔️
Info GET ✔️
Directory List GET ✔️
DNS ListRecords GET ✔️
FilterRecord* GET ✔️
Create POST ✔️
Update PATCH ✔️
Delete DELETE ✔️
Email Retrieve GET ✔️
Set POST ✔️
Now Retrieve GET ✔️
Garden GET ✔️
Update POST ✔️
PURL List GET ✔️
Retrieve GET ✔️
Create POST ✔️
Delete DELETE ✔️
Paste List GET ✔️
Retrieve GET ✔️
Create POST ✔️
Delete DELETE ✔️
Web Retrieve GET ✔️
Update POST ✔️
Service Info GET ✔️

Note Features marked with a * are additional to what the API provides

omglol-client-go's People

Contributors

dependabot[bot] avatar ejstreet avatar mcornick avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

omglol-client-go's Issues

Tests failing

See: https://github.com/ejstreet/omglol-client-go/actions/runs/4392364003/jobs/7692088804

Failing test logs:

=== RUN   TestGetSetRestoreWeb
    web_test.go:20: Previous content: 
    web_test.go:44: New content: 
    web_test.go:46: Expected content 'this is the new content
        
        it has newlines
        ', got ''
    web_test.go:49: Expected ContentBytes 'this is the new content
        
        it has newlines
        ', got ''
--- FAIL: TestGetSetRestoreWeb (4.09s)
=== RUN   TestGetClearAndSetEmails
    email_test.go:20: Original Destinations: [***]
    email_test.go:45: Destinations once cleared: [***]
    email_test.go:48: Expected 0, got 1
    email_test.go:64: Final Destinations: [***]
--- FAIL: TestGetClearAndSetEmails (3.63s)

Tests need improvement

A lot of the tests are very woolly, they need tightening up, with more detail around expected values.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.