service

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2018 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Name

func Name(service Service) string

Name returns the name of a service

Types

type Github

type Github struct {
}

Github represents the Github service

func (*Github) GetEvents added in v0.5.0

func (g *Github) GetEvents(ctx context.Context, eventChan chan<- *model.EventResult, token, user string, page, count int)

GetEvents returns the events for the authenticated user

func (*Github) GetStars

func (g *Github) GetStars(ctx context.Context, starChan chan<- *model.StarResult, token string, user string)

GetStars returns the stars for the specified user (empty string for authenticated user)

func (*Github) GetTrending added in v0.4.0

func (g *Github) GetTrending(ctx context.Context, trendingChan chan<- *model.StarResult, token string, language string, verbose bool)

GetTrending returns the trending repositories

func (*Github) Login

func (g *Github) Login(ctx context.Context) (string, error)

Login logs in to Github

type Gitlab added in v0.4.0

type Gitlab struct {
}

Gitlab represents the Gitlab service

func (*Gitlab) GetEvents added in v0.5.0

func (g *Gitlab) GetEvents(ctx context.Context, eventChan chan<- *model.EventResult, token, user string, page, count int)

GetEvents returns the events for the authenticated user

func (*Gitlab) GetStars added in v0.4.0

func (g *Gitlab) GetStars(ctx context.Context, starChan chan<- *model.StarResult, token string, user string)

GetStars returns the stars for the specified user (empty string for authenticated user)

func (*Gitlab) GetTrending added in v0.4.0

func (g *Gitlab) GetTrending(ctx context.Context, trendingChan chan<- *model.StarResult, token string, language string, verbose bool)

GetTrending returns the trending repositories

func (*Gitlab) Login added in v0.4.0

func (g *Gitlab) Login(ctx context.Context) (string, error)

Login logs in to Gitlab

type NotFound

type NotFound struct {
}

NotFound is used when the specified service is not found

func (*NotFound) GetEvents added in v0.5.0

func (nf *NotFound) GetEvents(ctx context.Context, eventChan chan<- *model.EventResult, token, user string, page, count int)

GetEvents is not implemented

func (*NotFound) GetStars

func (nf *NotFound) GetStars(ctx context.Context, starChan chan<- *model.StarResult, token string, user string)

GetStars is not implemented

func (*NotFound) GetTrending added in v0.4.0

func (nf *NotFound) GetTrending(ctx context.Context, trendingChan chan<- *model.StarResult, token string, language string, verbose bool)

GetTrending is not implemented

func (*NotFound) Login

func (nf *NotFound) Login(ctx context.Context) (string, error)

Login is not implemented

type Service

type Service interface {
	Login(ctx context.Context) (string, error)
	GetStars(ctx context.Context, starChan chan<- *model.StarResult, token, user string)
	GetTrending(ctx context.Context, trendingChan chan<- *model.StarResult, token, language string, verbose bool)
	GetEvents(ctx context.Context, eventChan chan<- *model.EventResult, token, user string, page, count int)
}

Service represents a service

func ForName

func ForName(name string) (Service, error)

ForName returns the service for a given name, or an error if it doesn't exist

Jump to

Keyboard shortcuts

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