Giter Site home page Giter Site logo

gowl's Introduction

Gowl

Gowl is a simple implementation of the prowl API in Go because implementing the Prowl API is a pretty good way to get started with learning a lanuage.

Example code

Gowl's goal is to make sending prowl notifications as easy as possible. This is all the code you need to start sending notifications to your iOS devices:

package main

import (
    "github.com/stevenleeg/gowl"
    "fmt"
)

func main() {
    fmt.Println("Sending test notification")

    notification := &gowl.Notification{
        Url: "http://example.com",
        Application: "Gowl",
        Event: "Test",
        Description: "Hello world",
    }

    g := gowl.New("[Your API key goes here]")
    g.Add(notification)
}

Documentation

Since this is my first venture into writing a Go library, I wanted to make a simple API that accomplishes its task elegantly. If you think anything here breaks this philosophy, go ahead and open an issue and tell me what sucks.

Func: New(api_key string) *gowl.Gowl

Creates a new instance of a gowl.Gowl type and returns a pointer to the struct

Type: Gowl

Manages interactions with an API based on an API key.

type Gowl struct {
    ApiKey string
}

Func: (gowl *Gowl) Add(notification *Notification) error**

Sends the provided notification struct to the API. Returns an error object if anything has gone wrong, nil if the notification was sent successfully.

Type: Notification

Represents a notification that will be sent to the API using Gowl.Add(...)

type Notification struct {
    Priority int,
    Url, Application, Event, Description string
}

License

Gowl is released under the MIT License. Do whatever you want with the code as long as you have fun with it!

gowl's People

Watchers

 avatar  avatar  avatar

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.