hookdeliveryforwarder

package
v0.27.6 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

README

hookdeliveryforwarder is currently in a Proof-of-Concept phase, not complete, and not supported. That being said, we are likely accept bug reports with concrete reproduction steps, but usage/support issues.

To use this, you need to write some Kubernetes manifest and a container image for deployment.

For other information, please see the original pull request introduced it.

https://github.com/actions/actions-runner-controller/pull/682

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, config *Config)

func SetupSignalHandler

func SetupSignalHandler() context.Context

SetupSignalHandler registers for SIGTERM and SIGINT. A stop channel is returned which is closed on one of these signals. If a second signal is caught, the program is terminated with exit code 1.

Types

type Checkpointer

type Checkpointer interface {
	GetOrCreate(hookID int64) (*State, error)
	Update(hookID int64, pos *State) error
}

func NewInMemoryLogPositionProvider

func NewInMemoryLogPositionProvider() Checkpointer

type Config

type Config struct {
	Rules        StringSlice
	MetricsAddr  string
	GitHubConfig github.Config
	Checkpointer Checkpointer
}

func (*Config) InitFlags

func (config *Config) InitFlags(fs *flag.FlagSet)

type Forwarder

type Forwarder struct {
	Repo   string
	Target string

	Hook gogithub.Hook

	PollingDelay time.Duration

	Client *github.Client

	Checkpointer Checkpointer
	// contains filtered or unexported fields
}

func (Forwarder) Errorf

func (f Forwarder) Errorf(format string, args ...interface{})

func (Forwarder) Logf

func (f Forwarder) Logf(format string, args ...interface{})

func (*Forwarder) Run

func (f *Forwarder) Run(ctx context.Context) error

type InMemoryCheckpointer

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

func (*InMemoryCheckpointer) GetOrCreate

func (p *InMemoryCheckpointer) GetOrCreate(hookID int64) (*State, error)

func (*InMemoryCheckpointer) Update

func (p *InMemoryCheckpointer) Update(hookID int64, pos *State) error

type MultiForwarder

type MultiForwarder struct {
	Rules []Rule

	Checkpointer Checkpointer
	// contains filtered or unexported fields
}

func New

func New(client *github.Client, rules []string) (*MultiForwarder, error)

func (MultiForwarder) Errorf

func (f MultiForwarder) Errorf(format string, args ...interface{})

func (*MultiForwarder) HandleReadyz

func (f *MultiForwarder) HandleReadyz(w http.ResponseWriter, r *http.Request)

func (MultiForwarder) Logf

func (f MultiForwarder) Logf(format string, args ...interface{})

func (*MultiForwarder) Run

func (f *MultiForwarder) Run(ctx context.Context) error

type Rule

type Rule struct {
	Repo   string
	Target string
	Hook   gogithub.Hook
}

type RuleConfig

type RuleConfig struct {
	Repo   []string      `json:"from"`
	Target string        `json:"to"`
	Hook   gogithub.Hook `json:"hook"`
}

type State

type State struct {
	DeliveredAt time.Time
	ID          int64
}

type StringSlice

type StringSlice []string

func (*StringSlice) Set

func (s *StringSlice) Set(value string) error

func (*StringSlice) String

func (s *StringSlice) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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