git

package
v0.0.0-...-c993650 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Copyright 2024.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2021.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2021.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2021.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Commit

type Commit map[string]interface{}

Commit is a polled Commit, specific to each implementation.

type CommitPoller

type CommitPoller interface {
	// Poll polls and updates the status, it returns the updated status, along
	// with the commit details.
	Poll(ctx context.Context, repo string, ps pollingv1alpha1.PollStatus) (pollingv1alpha1.PollStatus, Commit, error)
}

CommitPoller implementations can check with an upstream Git hosting service to determine the current SHA and ETag.

type FakePoller

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

FakePoller is a fake Git poller.

It can be configured with responses and errors.

func NewFakePoller

func NewFakePoller() *FakePoller

NewFakePoller creates and returns a new fake Git poller.

func (*FakePoller) AddFakeResponse

func (m *FakePoller) AddFakeResponse(repo string, in pollingv1alpha1.PollStatus, c Commit, out pollingv1alpha1.PollStatus)

AddFakeResponse sets up the response for a Poll call.

func (*FakePoller) FailWithError

func (m *FakePoller) FailWithError(err error)

FailWithError configures the poller to return errors.

func (*FakePoller) Poll

Poll is an implementation of the CommitPoller interface.

type GitHubPoller

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

func NewGitHubPoller

func NewGitHubPoller(c *http.Client, endpoint, authToken string) *GitHubPoller

NewGitHubPoller creates and returns a new GitHub poller.

func (GitHubPoller) Poll

type GitLabPoller

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

func NewGitLabPoller

func NewGitLabPoller(c *http.Client, endpoint, authToken string) *GitLabPoller

NewGitLabPoller creates a new GitLab poller.

func (GitLabPoller) Poll

Jump to

Keyboard shortcuts

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