web

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GHExistGitHubRepositoryFunc = gh.ExistGitHubRepository
	GHExistRunnerReleases       = gh.ExistRunnerReleases
	GHListRunnersFunc           = gh.ListRunners
	GHIsInstalledGitHubApp      = gh.IsInstalledGitHubApp
	GHGenerateGitHubAppsToken   = gh.GenerateGitHubAppsToken
	GHNewClientApps             = gh.NewClientGitHubApps
)

function pointer (for testing)

Functions

func HandleGitHubEvent added in v1.15.11

func HandleGitHubEvent(w http.ResponseWriter, r *http.Request, ds datastore.Datastore)

HandleGitHubEvent handle GitHub webhook event

func HandleMetrics added in v1.15.11

func HandleMetrics(w http.ResponseWriter, r *http.Request, ds datastore.Datastore)

HandleMetrics handle metrics endpoint

func NewMux added in v1.4.2

func NewMux(ds datastore.Datastore) *goji.Mux

NewMux create routed mux

func Serve

func Serve(ctx context.Context, ds datastore.Datastore) error

Serve start webhook receiver

Types

type ErrorResponse added in v1.10.9

type ErrorResponse struct {
	Error string `json:"error"`
}

ErrorResponse is error response

type TargetCreateParam added in v1.8.5

type TargetCreateParam struct {
	datastore.Target

	GHEDomain   *string `json:"ghe_domain"`   // ignore
	RunnerUser  *string `json:"runner_user"`  // nullable
	ProviderURL *string `json:"provider_url"` // nullable
}

TargetCreateParam is parameter for POST /target

func (*TargetCreateParam) ToDS added in v1.8.5

func (t *TargetCreateParam) ToDS(appToken string, tokenExpired time.Time) datastore.Target

ToDS convert to datastore.Target

type UserTarget added in v1.8.0

type UserTarget struct {
	UUID              uuid.UUID              `json:"id"`
	Scope             string                 `json:"scope"`
	TokenExpiredAt    time.Time              `json:"token_expired_at"`
	ResourceType      string                 `json:"resource_type"`
	ProviderURL       string                 `json:"provider_url"`
	Status            datastore.TargetStatus `json:"status"`
	StatusDescription string                 `json:"status_description"`
	CreatedAt         time.Time              `json:"created_at"`
	UpdatedAt         time.Time              `json:"updated_at"`
}

UserTarget is format for user

Jump to

Keyboard shortcuts

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