Documentation ¶
Overview ¶
Package restapi uisvc API for the user interface service; the service that is directly responsible for presenting data to users. This service typically runs at the border, and leverages session cookies or authentication tokens that we generate for users. It also is responsible for handling the act of oauth and user creation through its login hooks. uisvc typically talks to the datasvc and other services to accomplish its goal, it does not save anything locally or carry state.
Schemes: http Host: localhost BasePath: / Version: 1.0.0 Consumes: - application/json Produces: - application/json
swagger:meta
Index ¶
- Variables
- func AddCapability(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func AddRepositorySubscription(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func AddRepositoryToCI(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func CancelRun(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func CancelSubmission(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func CancelTask(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func CountRuns(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func CountRunsForTask(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func CountSubmissions(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func CountTasks(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func DeleteRepositoryFromCI(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func DeleteRepositorySubscription(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func DeleteToken(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func Errors(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func GetRun(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func GetRunsForTask(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func GetSubmission(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func GetSubmissionRuns(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func GetSubmissionTasks(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func GetToken(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func GetUserProperties(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func ListRepositoriesMy(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func ListRepositoriesSubscribed(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func ListRepositoriesVisible(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func ListRuns(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func ListSubmissions(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func ListSubscribedTasksForUser(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func ListTasks(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func LogAttach(pCtx context.Context, h *handlers.H, ctx *gin.Context, conn *websocket.Conn) error
- func LoggedIn(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func Login(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func Logout(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func MakeUIServer(client github.Client) (*handlers.H, chan struct{}, *tinyci.Client, *tinyci.Client, error)
- func RemoveCapability(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func ScanRepositories(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func Submit(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- func Upgrade(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
- type HandlerConfig
Constants ¶
This section is empty.
Variables ¶
var ( // SwaggerJSON embedded version of the swagger document used at generation time SwaggerJSON json.RawMessage // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time FlatSwaggerJSON json.RawMessage )
Functions ¶
func AddCapability ¶
AddCapability adds a capability for a user.
func AddRepositorySubscription ¶
func AddRepositorySubscription(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
AddRepositorySubscription adds a subscription for the user to the repo
func AddRepositoryToCI ¶
func AddRepositoryToCI(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
AddRepositoryToCI adds the repository to CI and subscribes the user to it.
func CancelSubmission ¶
func CancelSubmission(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
CancelSubmission cancels a submission by ID.
func CancelTask ¶
CancelTask cancels a task by ID.
func CountRunsForTask ¶
func CountRunsForTask(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
CountRunsForTask counts all the runs by task ID.
func CountSubmissions ¶
func CountSubmissions(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
CountSubmissions counts the submissions with optional repository/sha filtering.
func CountTasks ¶
CountTasks counts the task list with the supplied repo/sha filtering.
func DeleteRepositoryFromCI ¶
func DeleteRepositoryFromCI(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
DeleteRepositoryFromCI removes the repository from CI. that's it.
func DeleteRepositorySubscription ¶
func DeleteRepositorySubscription(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
DeleteRepositorySubscription removes the subscription to the repository from the user account.
func DeleteToken ¶
DeleteToken removes the existing token for the user.
func GetRunsForTask ¶
func GetRunsForTask(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
GetRunsForTask retrieves all the runs by task id. Pagination rules are in effect.
func GetSubmission ¶
GetSubmission retrieves a submission by id
func GetSubmissionRuns ¶
func GetSubmissionRuns(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
GetSubmissionRuns retrieves a submission's runs from the submission id
func GetSubmissionTasks ¶
func GetSubmissionTasks(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
GetSubmissionTasks retrieves a submission's task from the submission id
func GetToken ¶
GetToken obtains a new token from the db. If one is already set, you must delete it before this will return a new one.
func GetUserProperties ¶
func GetUserProperties(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
GetUserProperties gives an object containing information about the user.
func ListRepositoriesMy ¶
func ListRepositoriesMy(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
ListRepositoriesMy lists the repositories the user can modify.
func ListRepositoriesSubscribed ¶
func ListRepositoriesSubscribed(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
ListRepositoriesSubscribed lists all subscribed repos as JSON.
func ListRepositoriesVisible ¶
func ListRepositoriesVisible(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
ListRepositoriesVisible returns all the repos the user can see.
func ListSubmissions ¶
func ListSubmissions(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
ListSubmissions lists the submissions with optional repository/sha filtering and pagination.
func ListSubscribedTasksForUser ¶
func ListSubscribedTasksForUser(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
ListSubscribedTasksForUser lists only the tasks for the repositories the user is subscribed to.
func LogAttach ¶
LogAttach connects to a running logging process and outputs the return data as it arrives.
func Login ¶
Login processes the oauth response and optionally redirects the user if not logged in already.
func MakeUIServer ¶
func MakeUIServer(client github.Client) (*handlers.H, chan struct{}, *tinyci.Client, *tinyci.Client, error)
MakeUIServer makes a uisvc.
func RemoveCapability ¶
func RemoveCapability(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
RemoveCapability removes a capability from a user.
func ScanRepositories ¶
func ScanRepositories(pCtx context.Context, h *handlers.H, ctx *gin.Context) (interface{}, int, error)
ScanRepositories scans for owned and managed repositories for Add-to-CI operations.
Types ¶
type HandlerConfig ¶
type HandlerConfig struct{}
HandlerConfig is for on-disk configuration of the service. It will be parsed on boot and passed into each HandlerFunc.
func MakeHandlerConfig ¶
func MakeHandlerConfig(sc config.ServiceConfig) *HandlerConfig
MakeHandlerConfig takes a handlers.ServiceConfig and spits out a HandlerConfig.
func (HandlerConfig) Configure ¶
func (hc HandlerConfig) Configure(router handlers.Routes) error
Configure allows you to configure the routes, in particular. Setting the processing functions here will be a big part of your day job.
func (HandlerConfig) CustomInit ¶
func (hc HandlerConfig) CustomInit(h *handlers.H) error
CustomInit allows you to perform any final magic before boot.
func (HandlerConfig) DBConfigure ¶
func (hc HandlerConfig) DBConfigure(h *handlers.H) error
DBConfigure configures the database if necessary.
func (HandlerConfig) SetRoutes ¶
func (hc HandlerConfig) SetRoutes(h *handlers.H)
SetRoutes sets the routes in the handler so gin can execute them.