gitclient

package
v0.0.0-...-01a409d Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: MIT Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(innerClient IStatelessClient, name string, gitOwnerRepo string, cacheWindow time.Duration, cacheWindowWhenEmpty time.Duration, stateProvider state.IStateProvider) Client

func (*Client) GetQueuedJobs

func (c *Client) GetQueuedJobs(ctx context.Context) ([]*github.WorkflowRun, *time.Time, error)

func (*Client) GetState

func (c *Client) GetState() (*state.ClientState, error)

func (*Client) GetWorkflowInfo

func (c *Client) GetWorkflowInfo(ctx context.Context) (map[int64]utils.WorkflowInfo, error)

func (*Client) SaveState

func (c *Client) SaveState(state *state.ClientState) error

type GithubClient

type GithubClient struct {
	Owner      string
	Repository string
	// contains filtered or unexported fields
}

func NewGitHubClient

func NewGitHubClient(token string, owner string, repository string) GithubClient

func (*GithubClient) GetQueuedJobs

func (c *GithubClient) GetQueuedJobs(ctx context.Context) ([]*github.WorkflowRun, error)

func (*GithubClient) GetRemainingCreditsForToken

func (c *GithubClient) GetRemainingCreditsForToken(ctx context.Context) (string, string, int, error)

func (*GithubClient) GetWorkflowData

func (c *GithubClient) GetWorkflowData(ctx context.Context) (*map[int64]utils.WorkflowInfo, error)

type IClient

type IClient interface {
	GetQueuedJobs(ctx context.Context) (int, error)
	GetState() (*state.ClientState, error)
	SaveState(state *state.ClientState) error
}

type IStatelessClient

type IStatelessClient interface {
	GetQueuedJobs(ctx context.Context) ([]*github.WorkflowRun, error)
	GetRemainingCreditsForToken(ctx context.Context) (string, string, int, error)
	//TODO: Rename to GetWorkflowInfo
	GetWorkflowData(ctx context.Context) (*map[int64]utils.WorkflowInfo, error)
}

type Status

type Status int8
const (
	Unset Status = iota
	Valid
	Errored
)

Jump to

Keyboard shortcuts

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