Code Monkey home page Code Monkey logo

go-peekalink's Introduction

Peekalink Go API Client

This Go package is an API client for the Peekalink service.

Usage

1. Get the module:

go get github.com/jozsefsallai/go-peekalink

2. Import it:

package main

import (
  "github.com/jozsefsallai/go-peekalink"
)

3. Instantiate a client:

client := peekalink.NewClient("your-api-key")

Get link preview data:

preview, err := client.Preview("https://okuna.io")
if err != nil {
  panic(err)
}

fmt.Println(preview)

Get link availability status:

status, err := client.IsAvailable("https://okuna.io")
if err != nil {
  panic(err)
}

fmt.Println(status)

Please read the documentation of the module for more information about all the available methods, types, and constants.

Contribution

The Peekalink Go API client library is an open-source project and any contribution is welcome! When contributing, we kindly ask you to follow the Go style guide and use gofmt whenever possible.

For major changes, we also expect that you update/write unit tests and make sure they pass. Most unit tests will not require direct interaction with the real API, however, some of them do need to check against actual data. By default, these tests will not run when running go test, unless you provide a Peekalink API key through the PEEKALINK_API_KEY environment variable:

PEEKALINK_API_KEY=your-api-key go test -v ./...

Please note that running the tests with your API key will count towards your usage quota.

License

This Go module is licensed under the MIT license.

go-peekalink's People

Contributors

jozsefsallai avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

go-peekalink's Issues

Package spec needs to be rewritten, or hosted at ankida

I will admit to being new to go, so I'm maybe missing something.

This looks like a very cool package, but not usable due to a broken package path.
It looks like the code is all setup for this to be hosted at github/ankida/go-peekalink but there is no repository there.

The README in step 1 says to install via go get github.com/ankida/go-peekalink, but that repository doesn't exist. The code package declarations are all setup to use the package at ankida instead also.

There might be a way to let go alias this package, but as someone relatively new to go I couldn't get it to work, because even though I can alias the entire package as "peekalink", the files all reference the ankida repo.

If you intend to continue this package at jozsefsallai I would be happy to submit a PR to the README and files to fix the broken package paths.

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.