Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
GitHubWebhookKeyMountPath string `env:"WEBHOOK_KEY_MOUNT_PATH,required"`
GitHubWebhookKeyName string `env:"WEBHOOK_KEY_NAME,required"`
Port string `env:"PORT,default=8080"`
PubSubTopic string `env:"PUBSUB_TOPIC,required"`
PubSubProjectID string `env:"PUBSUB_PROJECT_ID,required"`
}
Config defines the set of environment variables required for running the webhook service.
func (*Config) ToFlags ¶
ToFlags binds the config to the cli.FlagSet and returns it.
type FileReader ¶
FileReader can read a file and return the content.
type MockFileReader ¶
type MockFileReader struct {
ReadFileMock *ReadFileResErr
ReadFileFunc func(filename string) ([]byte, error)
}
type OSFileReader ¶
type OSFileReader struct{}
OSFileReader implements FileReader using the os package.
type ReadFileResErr ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server provides the server implementation for receiving webhooks.
func NewServer ¶
func NewServer(ctx context.Context, h *renderer.Renderer, cfg *Config, wco *WebhookClientOptions) (*Server, error)
NewServer creates a new HTTP server implementation that will handle receiving webhook payloads.
type WebhookClientOptions ¶
type WebhookClientOptions struct {
PubSubClientOverride *pubsub.Client
OSFileReaderOverride FileReader
}
WebhookClientOptions encapsulate client config options as well as dependency implementation overrides.
Click to show internal directories.
Click to hide internal directories.