healthcheck

package
v0.38.2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReadPublicKey  = "read:public_key"
	ReadUser       = "read:user"
	ReadProject    = "read:project"
	RepoDeployment = "repo_deployment"
	ReadRepoHook   = "read:repo_hook"
	PublicRepo     = "public_repo"
	ReadOrg        = "read:org"
	RepoStatus     = "repo:status"
	ReadPackages   = "read:packages"
)

Define required permissions as constants

Variables

This section is empty.

Functions

func GithubIntegrationHealthcheck

func GithubIntegrationHealthcheck(cfg Config) (bool, error)

func IsHealthy

func IsHealthy(ctx context.Context, client *github.Client, org string) error

IsHealthy checks if the PAT has read access to all required artifacts in the organization

Types

type Config

type Config struct {
	Token            string `json:"token"`
	OrganizationName string `json:"organization_name"`
}

Config represents the JSON input configuration

type Details

type Details struct {
	RequiredPermissions []string `json:"required_permissions"`
	MissingPermissions  []string `json:"missing_permissions"`
}

Details contains required and missing permissions

type HealthStatus

type HealthStatus struct {
	Organization string  `json:"organization"`
	Healthy      bool    `json:"healthy"`
	Details      Details `json:"details"`
}

HealthStatus represents the structure of the JSON output

type PermissionCheck

type PermissionCheck struct {
	Name  string
	Check func(ctx context.Context, client *github.Client, org string) error
}

PermissionCheck represents a permission and its corresponding check function

Jump to

Keyboard shortcuts

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