Documentation
¶
Index ¶
- Constants
- type BuildCommand
- func (c *BuildCommand) GetDefaultBuildArgs(target string) string
- func (c *BuildCommand) Handle(s *discordgo.Session, i *discordgo.InteractionCreate)
- func (c *BuildCommand) HasBuildArgs(target string) bool
- func (c *BuildCommand) Name() string
- func (c *BuildCommand) Register(session *discordgo.Session) error
- func (c *BuildCommand) RegisterWithGuild(session *discordgo.Session, guildID string) error
- func (c *BuildCommand) UpdateChoices(session *discordgo.Session) error
- type GitHubFile
- type Workflow
- type WorkflowFetcher
- type WorkflowInfo
- type WorkflowInputs
Constants ¶
const (
// DefaultRepository is the default repository for the eth-client-docker-image-builder.
DefaultRepository = "ethpandaops/eth-client-docker-image-builder"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildCommand ¶
type BuildCommand struct {
// contains filtered or unexported fields
}
BuildCommand handles the /build command.
func NewBuildCommand ¶
func NewBuildCommand(log *logrus.Logger, bot common.BotContext, githubToken string, client *http.Client) *BuildCommand
NewBuildCommand creates a new build command.
func (*BuildCommand) GetDefaultBuildArgs ¶ added in v0.0.25
func (c *BuildCommand) GetDefaultBuildArgs(target string) string
GetDefaultBuildArgs returns the default build arguments for a workflow or client, if any.
func (*BuildCommand) Handle ¶
func (c *BuildCommand) Handle(s *discordgo.Session, i *discordgo.InteractionCreate)
Handle handles the /build command.
func (*BuildCommand) HasBuildArgs ¶ added in v0.0.25
func (c *BuildCommand) HasBuildArgs(target string) bool
HasBuildArgs returns whether the given workflow or client supports build arguments.
func (*BuildCommand) Name ¶
func (c *BuildCommand) Name() string
Name returns the name of the command.
func (*BuildCommand) Register ¶
func (c *BuildCommand) Register(session *discordgo.Session) error
Register registers the /build command with the given discord session (globally).
func (*BuildCommand) RegisterWithGuild ¶ added in v0.0.36
func (c *BuildCommand) RegisterWithGuild(session *discordgo.Session, guildID string) error
RegisterWithGuild registers the /build command with a specific guild.
func (*BuildCommand) UpdateChoices ¶ added in v0.0.26
func (c *BuildCommand) UpdateChoices(session *discordgo.Session) error
UpdateChoices updates the command choices by editing the existing command with fresh client and tool data.
type GitHubFile ¶ added in v0.0.28
type GitHubFile struct {
Name string `json:"name"`
Path string `json:"path"`
DownloadURL string `json:"download_url"`
Type string `json:"type"`
}
GitHubFile represents a file from GitHub API.
type Workflow ¶ added in v0.0.28
type Workflow struct {
On struct {
WorkflowDispatch struct {
Inputs WorkflowInputs `yaml:"inputs"`
} `yaml:"workflow_dispatch"`
} `yaml:"on"`
}
Workflow represents a GitHub workflow file.
type WorkflowFetcher ¶ added in v0.0.28
type WorkflowFetcher struct {
// contains filtered or unexported fields
}
WorkflowFetcher handles fetching and caching workflow information.
func NewWorkflowFetcher ¶ added in v0.0.28
func NewWorkflowFetcher(httpClient *http.Client, githubToken string, log *logrus.Logger, botContext common.BotContext) *WorkflowFetcher
NewWorkflowFetcher creates a new workflow fetcher.
func (*WorkflowFetcher) GetAllWorkflows ¶ added in v0.0.28
func (wf *WorkflowFetcher) GetAllWorkflows() (map[string]WorkflowInfo, error)
GetAllWorkflows returns all workflows from the GitHub repository.
func (*WorkflowFetcher) GetToolWorkflows ¶ added in v0.0.28
func (wf *WorkflowFetcher) GetToolWorkflows() (map[string]WorkflowInfo, error)
GetToolWorkflows returns tool workflows, excluding known EL/CL clients.
func (*WorkflowFetcher) RefreshCache ¶ added in v0.0.28
func (wf *WorkflowFetcher) RefreshCache() error
RefreshCache forces a refresh of the workflow cache.
type WorkflowInfo ¶ added in v0.0.28
type WorkflowInfo struct {
Repository string
Branch string
Name string
BuildArgs string
HasBuildArgs bool
}
WorkflowInfo contains information about a workflow.
type WorkflowInputs ¶ added in v0.0.28
type WorkflowInputs struct {
Repository struct {
Default string `yaml:"default"`
} `yaml:"repository"`
Ref struct {
Default string `yaml:"default"`
} `yaml:"ref"`
BuildArgs *struct {
Default string `yaml:"default"`
} `yaml:"build_args,omitempty"`
}
WorkflowInputs represents the inputs section of a GitHub workflow.