yo

package module
v0.0.0-...-0341561 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2014 License: MIT Imports: 3 Imported by: 3

README

go-yo

Golang client for the Yo API

Documentation: http://godoc.org/github.com/sjkaliski/go-yo

Build Status: Build Status

API Info: https://medium.com/@YoAppStatus/yo-developers-api-e7f2f0ec5c3c

Usage

With token in hand, to create a new Yo client simply

package main

import (
  "github.com/sjkaliski/go-yo"
)

func main() {
  client := yo.NewClient("my_token")
}

To send a message to all users who subscribe to you

err := client.YoAll()

To send a message to a specific user

err := client.YoUser("some_user")

Tests

To run tests

$ go test ./...

Documentation

Overview

The yo package provides an api client for the Yo app api, with methods to send Yo's to users.

Index

Constants

This section is empty.

Variables

View Source
var YO_API = "http://api.justyo.co"

Yo API endpoint.

Functions

This section is empty.

Types

type Client

type Client struct {
	Token string
}

Yo API Client.

func NewClient

func NewClient(token string) *Client

Creates a new Client.

func (*Client) YoAll

func (c *Client) YoAll() error

Sends a "Yo" to all users who subscribe to the active account. Expects a 201 response.

func (c *Client) YoAllLink(link string) error

YoAllLink sends a "Yo" to all subscribed users of the API account with the link specified.

func (*Client) YoUser

func (c *Client) YoUser(username string) error

Sends a "Yo" to the specified user (who must subscribe) to the active account. Expects a 201 response.

func (c *Client) YoUserLink(username, link string) error

YoUserLink sends a "Yo" to the specified user (who must subscribe) with a link to the active account. Expects a 201 response.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL