social

package
v0.0.0-...-3518944 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2017 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Share

func Share(ctx *app.Context, s Service, item *Item, config interface{}) (interface{}, error)

Types

type FacebookConfig

type FacebookConfig struct {
	App         *facebook.App
	AccessToken string
}

type Item

type Item struct {
	Title       string
	Description string
	Links       []*url.URL
	Images      []*url.URL
	Data        interface{}
}

type PinterestConfig

type PinterestConfig struct {
	Account *pinterest.Account
	// Might be *pinterest.Board, string (board name) or nil (first board found)
	Board interface{}
}

type Service

type Service int
const (
	Facebook Service = iota + 1
	Twitter
	Pinterest
)

func (Service) String

func (s Service) String() string

type ShareProvider

type ShareProvider interface {
	LastShare(ctx *app.Context, service Service) (time.Time, error)
	Item(ctx *app.Context, service Service) (*Item, error)
	Shared(ctx *app.Context, service Service, item *Item, result interface{}, err error)
}

type Sharer

type Sharer struct {
	// Name indicates the name of the gnd.la/tasks.Task which will
	// be created when scheduling this Sharer. If empty, a name
	// will be derived from the service and the Sharer instance.
	Name string
	// contains filtered or unexported fields
}

func NewSharer

func NewSharer(s Service, provider ShareProvider, config interface{}) *Sharer

func (*Sharer) Schedule

func (s *Sharer) Schedule(a *app.App, interval time.Duration)

func (*Sharer) Stop

func (s *Sharer) Stop()

type TwitterConfig

type TwitterConfig struct {
	App   *twitter.App
	Token *twitter.Token
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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