hookd

package
v0.0.0-...-f8970bf Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Deployments(ctx context.Context, opts ...RequestOption) ([]Deploy, error)
	ChangeDeployKey(ctx context.Context, team string) (*DeployKey, error)
	DeployKey(ctx context.Context, team string) (*DeployKey, error)
}

func New

func New(endpoint, psk string, log logrus.FieldLogger) Client

New creates a new hookd client

type Deploy

type Deploy struct {
	DeploymentInfo DeploymentInfo `json:"deployment"`
	Statuses       []Status       `json:"statuses"`
	Resources      []Resource     `json:"resources"`
}

type DeployKey

type DeployKey struct {
	Team    string    `json:"team"`
	Key     string    `json:"key"`
	Expires time.Time `json:"expires"`
	Created time.Time `json:"created"`
}

type DeploymentInfo

type DeploymentInfo struct {
	ID               string    `json:"id"`
	Team             slug.Slug `json:"team"`
	Cluster          string    `json:"cluster"`
	Created          time.Time `json:"created"`
	GithubRepository string    `json:"githubRepository"`
}

type DeploymentsResponse

type DeploymentsResponse struct {
	Deployments []Deploy `json:"deployments"`
}

type MockClient

type MockClient struct {
	mock.Mock
}

MockClient is an autogenerated mock type for the Client type

func NewMockClient

func NewMockClient(t interface {
	mock.TestingT
	Cleanup(func())
},
) *MockClient

NewMockClient creates a new instance of MockClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockClient) ChangeDeployKey

func (_m *MockClient) ChangeDeployKey(ctx context.Context, team string) (*DeployKey, error)

ChangeDeployKey provides a mock function with given fields: ctx, team

func (*MockClient) DeployKey

func (_m *MockClient) DeployKey(ctx context.Context, team string) (*DeployKey, error)

DeployKey provides a mock function with given fields: ctx, team

func (*MockClient) Deployments

func (_m *MockClient) Deployments(ctx context.Context, opts ...RequestOption) ([]Deploy, error)

Deployments provides a mock function with given fields: ctx, opts

func (*MockClient) EXPECT

func (_m *MockClient) EXPECT() *MockClient_Expecter

type MockClient_ChangeDeployKey_Call

type MockClient_ChangeDeployKey_Call struct {
	*mock.Call
}

MockClient_ChangeDeployKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ChangeDeployKey'

func (*MockClient_ChangeDeployKey_Call) Return

func (*MockClient_ChangeDeployKey_Call) Run

func (*MockClient_ChangeDeployKey_Call) RunAndReturn

type MockClient_DeployKey_Call

type MockClient_DeployKey_Call struct {
	*mock.Call
}

MockClient_DeployKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeployKey'

func (*MockClient_DeployKey_Call) Return

func (*MockClient_DeployKey_Call) Run

func (*MockClient_DeployKey_Call) RunAndReturn

type MockClient_Deployments_Call

type MockClient_Deployments_Call struct {
	*mock.Call
}

MockClient_Deployments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Deployments'

func (*MockClient_Deployments_Call) Return

func (*MockClient_Deployments_Call) Run

func (*MockClient_Deployments_Call) RunAndReturn

type MockClient_Expecter

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

func (*MockClient_Expecter) ChangeDeployKey

func (_e *MockClient_Expecter) ChangeDeployKey(ctx interface{}, team interface{}) *MockClient_ChangeDeployKey_Call

ChangeDeployKey is a helper method to define mock.On call

  • ctx context.Context
  • team string

func (*MockClient_Expecter) DeployKey

func (_e *MockClient_Expecter) DeployKey(ctx interface{}, team interface{}) *MockClient_DeployKey_Call

DeployKey is a helper method to define mock.On call

  • ctx context.Context
  • team string

func (*MockClient_Expecter) Deployments

func (_e *MockClient_Expecter) Deployments(ctx interface{}, opts ...interface{}) *MockClient_Deployments_Call

Deployments is a helper method to define mock.On call

  • ctx context.Context
  • opts ...RequestOption

type RequestOption

type RequestOption func(*http.Request)

func WithCluster

func WithCluster(cluster string) RequestOption

func WithIgnoreTeams

func WithIgnoreTeams(teams ...string) RequestOption

func WithLimit

func WithLimit(limit int) RequestOption

func WithTeam

func WithTeam(team string) RequestOption

type Resource

type Resource struct {
	ID        string `json:"id"`
	Group     string `json:"group"`
	Kind      string `json:"kind"`
	Name      string `json:"name"`
	Version   string `json:"version"`
	Namespace string `json:"namespace"`
}

type Status

type Status struct {
	ID      string    `json:"id"`
	Status  string    `json:"status"`
	Message string    `json:"message"`
	Created time.Time `json:"created"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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