apis

package
v0.0.0-...-5c10e41 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LimitHandler

func LimitHandler(lmt *limiter.Limiter) gin.HandlerFunc

Types

type Config

type Config struct {
	Org            string  `yaml:"org"`
	AppID          int64   `yaml:"appID"`
	InstallationID int64   `yaml:"installationID"`
	PrivateKey     string  `yaml:"privateKey"`
	Logging        Logging `yaml:"logging"`
	Server         Server  `yaml:"server"`
}

type JSONResultError

type JSONResultError struct {
	Code  int    `json:"Code" `
	Error string `json:"Error"`
}

type JSONResultSuccess

type JSONResultSuccess struct {
	Code     int         `json:"Code" `
	Response interface{} `json:"Response"`
}

type Logging

type Logging struct {
	Compression  bool   `yaml:"compression"`
	Ephemeral    bool   `yaml:"ephemeral"`
	Level        string `yaml:"level"`
	LogDirectory string `yaml:"logDirectory"`
	MaxAge       int    `yaml:"maxAge"`
	MaxBackups   int    `yaml:"maxBackups"`
	MaxSize      int    `yaml:"maxSize"`
}

type MaintainershipClient

type MaintainershipClient struct {
	TeamsClient teamsClient
	UsersClient usersClient
}

type Manager

type Manager struct {
	ActionsClient      actionsClient
	RepositoriesClient repositoriesClient
	TeamsClient        teamsClient

	Limit  *limiter.Limiter
	Router *gin.Engine
	Server *http.Server

	Config *Config
	Logger *logrus.Logger

	CreateMaintainershipClient func(string, string) (*MaintainershipClient, *github.User, error)
}

func (*Manager) DoGroupCreate

func (m *Manager) DoGroupCreate(c *gin.Context)

DoGroupCreate Create a new GitHub Action organization Runner Group @Summary Create a new GitHub Action organization Runner Group @Description Creates a new GitHub Action organization runner group named with the team slug @Tags Groups @Produce json @Param team query string true "Canonical **slug** of the GitHub team" @Param Authorization header string true "Authorization token" @Success 200 {object} JSONResultSuccess{Code=int,Response=string} @Router /group-create [post] @Security ApiKeyAuth

func (*Manager) DoGroupDelete

func (m *Manager) DoGroupDelete(c *gin.Context)

DoGroupDelete Deletes an existing GitHub Action organization Runner Group @Summary Deletes an existing GitHub Action organization Runner Group @Description Deletes an existing GitHub Action organization runner group named with the team slug @Tags Groups @Produce json @Param team query string true "Canonical **slug** of the GitHub team" @Success 200 {object} JSONResultSuccess{Code=int,Response=string} @Router /group-delete [delete] @Security ApiKeyAuth

func (*Manager) DoGroupList

func (m *Manager) DoGroupList(c *gin.Context)

DoGroupList List all resources associated with a GitHub Action organization Runner Group @Summary List all resources associated with a GitHub Action organization Runner Group @Description List all repositories and runners assigned to a GitHub Action organization runner group named with the team slug @Tags Groups @Produce json @Param team query string true "Canonical **slug** of the GitHub team" @Success 200 {object} JSONResultSuccess{Code=int,Response=listResponse} @Router /group-list [get] @Security ApiKeyAuth

func (*Manager) DoReposAdd

func (m *Manager) DoReposAdd(c *gin.Context)

DoReposAdd Add new repositories to an existing GitHub Actions organization runner group @Summary Add new repositories to an existing GitHub Actions organization runner group @Description Adds new repositories to an existing GitHub Actions organization named with the team slug @Tags Repos @Produce json @Param team query string true "Canonical **slug** of the GitHub team" @Param repos query []string true "Comma-seperated list of repository slugs" @Success 200 {object} JSONResultSuccess{Code=int,Response=string} @Router /repos-add [patch] @Security ApiKeyAuth

func (*Manager) DoReposRemove

func (m *Manager) DoReposRemove(c *gin.Context)

DoReposRemove Remove existing repositories from an existing GitHub Actions organization runner group @Summary Remove existing repositories from an existing GitHub Actions organization runner group @Description Removes existing repositories to an existing GitHub Actions organization named with the team slug @Tags Repos @Produce json @Param team query string true "Canonical **slug** of the GitHub team" @Param repos query []string true "Comma-seperated list of repository slugs" @Success 200 {object} JSONResultSuccess{Code=int,Response=string} @Router /repos-remove [patch] @Security ApiKeyAuth

func (*Manager) DoReposSet

func (m *Manager) DoReposSet(c *gin.Context)

DoReposSet Replaces all existing repositories in an existing GitHub Actions organization runner group with a new set of repositories @Summary Replaces all existing repositories in an existing GitHub Actions organization runner group with a new set of repositories @Description Replaces all existing repositories in an existing GitHub Actions organization named with the team slug with a new set of repositories @Tags Repos @Produce json @Param team query string true "Canonical **slug** of the GitHub team" @Param repos query []string true "Comma-seperated list of repository slugs" @Success 200 {object} JSONResultSuccess{Code=int,Response=string} @Router /repos-set [patch] @Security ApiKeyAuth

func (*Manager) DoTokenRegister

func (m *Manager) DoTokenRegister(c *gin.Context)

DoTokenRegister Request a GitHub Action organization runner registration token @Summary Create a new GitHub Action organization runner registration token @Description Creates a new GitHub Action organization runner removal token that can be used to configure GitHub Action runners at the organization level @Tags Tokens @Produce json @Param team query string true "Canonical **slug** of the GitHub team" @Success 200 {object} JSONResultSuccess{Code=int,Response=github.RegistrationToken} @Router /token-register [get] @Security ApiKeyAuth

func (*Manager) DoTokenRemove

func (m *Manager) DoTokenRemove(c *gin.Context)

DoTokenRemove Request a GitHub Action organization runner removal token @Summary Create a new GitHub Action organization runner removal token @Description Creates a new GitHub Action organization runner removal token that can be used remove a GitHub Action runners at the organization level @Tags Tokens @Produce json @Param team query string true "Canonical **slug** of the GitHub team" @Success 200 {object} JSONResultSuccess{Code=int,Response=github.RegistrationToken} @Router /token-remove [get] @Security ApiKeyAuth

func (*Manager) Serve

func (m *Manager) Serve()

func (*Manager) SetRoutes

func (m *Manager) SetRoutes()

func (*Manager) Status

func (m *Manager) Status(c *gin.Context)

type Server

type Server struct {
	Address   string  `yaml:"address"`
	Port      int     `yaml:"port"`
	RateLimit float64 `yaml:"rateLimit"`
	TLS       TLS     `yaml:"tls"`
}

type TLS

type TLS struct {
	Enabled  bool   `yaml:"enabled"`
	CertFile string `yaml:"certFile"`
	KeyFile  string `yaml:"keyFile"`
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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