services

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package services provides the functionality for all supported services (GitHub)

Package services provides the functionality for all supported services (GitHub)

Package services provides the functionality for all supported services (GitHub)

Index

Constants

View Source
const DefaultUpdateFileName string = ".walter"

DEFAULT_UPDATE_FILE_NAME is the default file name of status of Walter service. The file name can be overridden with the configuration file.

Variables

This section is empty.

Functions

func SaveLastUpdate

func SaveLastUpdate(fname string, update Update) bool

SaveLastUpdate saves the supplied update to the filename

Types

type GitHubClient

type GitHubClient struct {
	Repo         string `config:"repo"`
	From         string `config:"from"`
	Token        string `config:"token"`
	UpdateFile   string `config:"update"`
	TargetBranch string `config:"branch"`
	BaseUrl      *url.URL
}

GitHubClient struct

func (*GitHubClient) GetCommits

func (githubClient *GitHubClient) GetCommits(update Update) (*list.List, error)

GetCommits get a list of all the commits for the current update

func (*GitHubClient) GetUpdateFilePath

func (githubClient *GitHubClient) GetUpdateFilePath() string

GetUpdateFilePath returns the update file name

func (*GitHubClient) RegisterResult

func (githubClient *GitHubClient) RegisterResult(result Result) error

RegisterResult registers the supplied result

type LocalClient

type LocalClient struct{}

LocalClient struct

func (*LocalClient) GetCommits

func (localClient *LocalClient) GetCommits(update Update) (*list.List, error)

GetCommits gets the commits for the current update

func (*LocalClient) GetUpdateFilePath

func (localClient *LocalClient) GetUpdateFilePath() string

GetUpdateFilePath returns the update file path

func (*LocalClient) RegisterResult

func (localClient *LocalClient) RegisterResult(result Result) error

RegisterResult resgisters the supplied result

type Result

type Result struct {
	State   string
	SHA     string
	Message string
	Url     string
}

Result struct

type Service

type Service interface {
	RegisterResult(Result) error
	GetCommits(update Update) (*list.List, error)
	GetUpdateFilePath() string
}

Service interface

func InitService

func InitService(stype string) (Service, error)

InitService initializes the service

type Update

type Update struct {
	Time      time.Time `json:"time"`
	Succeeded bool      `json:"succeeded"`
	Status    string    `json:"status"`
}

Update struct

func LoadLastUpdate

func LoadLastUpdate(fname string) (Update, error)

LoadLastUpdate loads the last update

Jump to

Keyboard shortcuts

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