hbr

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package hbr is a generated GoMock package.

Index

Constants

View Source
const (
	CreateBranch = "master"
	MacRelease   = "darwin_amd64"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	GitHub github.GitHub
}

Client define functions for Homebrew Formula

func (*Client) CreateFormula

func (g *Client) CreateFormula(app, font string, private bool, release *LatestRelease) error

func (*Client) GetCurrentRelease

func (g *Client) GetCurrentRelease(repo string) (*LatestRelease, error)

GetCurrentRelease returns the latest release version and calculates its checksum

func (*Client) UpdateFormula

func (g *Client) UpdateFormula(app, branch string, merge bool, release *LatestRelease) error

UpdateFormula updates the formula file to point to the latest release

type Generator

type Generator func(token, owner string) HBRWrapper

Generator is a type for method to generate HBRWrapper

type HBRClient

type HBRClient interface {
	GetCurrentRelease(repo string) (*LatestRelease, error)
	CreateFormula(app, font string, private bool, release *LatestRelease) error
	UpdateFormula(app, branch string, merge bool, release *LatestRelease) error
}

HBRClient abstracts Client's interface

type HBRWrapper

type HBRWrapper interface {
	GetCurrentRelease(repo string) *LatestRelease
	CreateFormula(app, font string, private bool, release *LatestRelease)
	UpdateFormula(app, branch string, merge bool, release *LatestRelease)
	Err() error
}

HBRWrapper abstracts Wrapper's interface

func GenerateHBR

func GenerateHBR(token, owner string) HBRWrapper

GenerateHBR defines a method to create HBRWrapper

type LatestRelease

type LatestRelease struct {
	// contains filtered or unexported fields
}

LatestRelease contains latest release info

type MockHBRClient

type MockHBRClient struct {
	// contains filtered or unexported fields
}

MockHBRClient is a mock of HBRClient interface

func NewMockHBRClient

func NewMockHBRClient(ctrl *gomock.Controller) *MockHBRClient

NewMockHBRClient creates a new mock instance

func (*MockHBRClient) CreateFormula

func (m *MockHBRClient) CreateFormula(app, font string, private bool, release *LatestRelease) error

CreateFormula mocks base method

func (*MockHBRClient) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockHBRClient) GetCurrentRelease

func (m *MockHBRClient) GetCurrentRelease(repo string) (*LatestRelease, error)

GetCurrentRelease mocks base method

func (*MockHBRClient) UpdateFormula

func (m *MockHBRClient) UpdateFormula(app, branch string, merge bool, release *LatestRelease) error

UpdateFormula mocks base method

type MockHBRClientMockRecorder

type MockHBRClientMockRecorder struct {
	// contains filtered or unexported fields
}

MockHBRClientMockRecorder is the mock recorder for MockHBRClient

func (*MockHBRClientMockRecorder) CreateFormula

func (mr *MockHBRClientMockRecorder) CreateFormula(app, font, private, release interface{}) *gomock.Call

CreateFormula indicates an expected call of CreateFormula

func (*MockHBRClientMockRecorder) GetCurrentRelease

func (mr *MockHBRClientMockRecorder) GetCurrentRelease(repo interface{}) *gomock.Call

GetCurrentRelease indicates an expected call of GetCurrentRelease

func (*MockHBRClientMockRecorder) UpdateFormula

func (mr *MockHBRClientMockRecorder) UpdateFormula(app, branch, merge, release interface{}) *gomock.Call

UpdateFormula indicates an expected call of UpdateFormula

type MockHBRWrapper

type MockHBRWrapper struct {
	// contains filtered or unexported fields
}

MockHBRWrapper is a mock of HBRWrapper interface

func NewMockHBRWrapper

func NewMockHBRWrapper(ctrl *gomock.Controller) *MockHBRWrapper

NewMockHBRWrapper creates a new mock instance

func (*MockHBRWrapper) CreateFormula

func (m *MockHBRWrapper) CreateFormula(app, font string, private bool, release *LatestRelease)

CreateFormula mocks base method

func (*MockHBRWrapper) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockHBRWrapper) Err

func (m *MockHBRWrapper) Err() error

Err mocks base method

func (*MockHBRWrapper) GetCurrentRelease

func (m *MockHBRWrapper) GetCurrentRelease(repo string) *LatestRelease

GetCurrentRelease mocks base method

func (*MockHBRWrapper) UpdateFormula

func (m *MockHBRWrapper) UpdateFormula(app, branch string, merge bool, release *LatestRelease)

UpdateFormula mocks base method

type MockHBRWrapperMockRecorder

type MockHBRWrapperMockRecorder struct {
	// contains filtered or unexported fields
}

MockHBRWrapperMockRecorder is the mock recorder for MockHBRWrapper

func (*MockHBRWrapperMockRecorder) CreateFormula

func (mr *MockHBRWrapperMockRecorder) CreateFormula(app, font, private, release interface{}) *gomock.Call

CreateFormula indicates an expected call of CreateFormula

func (*MockHBRWrapperMockRecorder) Err

Err indicates an expected call of Err

func (*MockHBRWrapperMockRecorder) GetCurrentRelease

func (mr *MockHBRWrapperMockRecorder) GetCurrentRelease(repo interface{}) *gomock.Call

GetCurrentRelease indicates an expected call of GetCurrentRelease

func (*MockHBRWrapperMockRecorder) UpdateFormula

func (mr *MockHBRWrapperMockRecorder) UpdateFormula(app, branch, merge, release interface{}) *gomock.Call

UpdateFormula indicates an expected call of UpdateFormula

type Wrapper

type Wrapper struct {
	// contains filtered or unexported fields
}

Wrapper wraps Client to avoid ugly error handling

func (*Wrapper) CreateFormula

func (w *Wrapper) CreateFormula(app, font string, private bool, release *LatestRelease)

CreateFormula wraps client's CreateFormula method

func (*Wrapper) Err

func (w *Wrapper) Err() error

Err returns the value of the err filed

func (*Wrapper) GetCurrentRelease

func (w *Wrapper) GetCurrentRelease(repo string) *LatestRelease

GetCurrentRelease wraps client's GetCurrentRelease method

func (*Wrapper) UpdateFormula

func (w *Wrapper) UpdateFormula(app, branch string, merge bool, release *LatestRelease)

UpdateFormula wraps client's UpdateFormula method

Jump to

Keyboard shortcuts

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