api

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

endpoints.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGithubFactory

func NewGithubFactory(server *Server) *githubFactory

Types

type ApprovalYesNoQuestionAnswersResponse added in v0.0.2

type ApprovalYesNoQuestionAnswersResponse struct {
	Uuid      string                                                    `json:"uuid"`
	Questions []postgres.GetSortedApprovalYesNoQuestionAnswersByUuidRow `json:"questions"`
}

type PullRequestEventCreateParams

type PullRequestEventCreateParams struct {
	InstallationID   int32
	GithubUser       postgres.CreateGithubUserParams
	Repo             postgres.CreateRepoParams
	PullRequest      postgres.CreatePullRequestParams
	PullRequestEvent postgres.CreatePullRequestEventParams
	Approval         postgres.CreateApprovalParams
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server serves HTTP requests for the api and uses store to interact with the Querier interface created by sqlc.

func NewServer

func NewServer(connPool *pgxpool.Pool, querier postgres.Querier) (*Server, error)

func (*Server) AddAllRoutes

func (server *Server) AddAllRoutes()

Add all routes here

func (*Server) AddApprovalRoutes

func (server *Server) AddApprovalRoutes()

func (*Server) AddHealthRoutes

func (server *Server) AddHealthRoutes()

func (*Server) AddWebhookEventsRoutes

func (server *Server) AddWebhookEventsRoutes()

func (*Server) GetApproval

func (server *Server) GetApproval(w http.ResponseWriter, req *http.Request)

func (*Server) GetApprovalQueryParam

func (server *Server) GetApprovalQueryParam(w http.ResponseWriter, req *http.Request)

func (*Server) GetHealth

func (server *Server) GetHealth(w http.ResponseWriter, r *http.Request)

func (*Server) GetOrCreateApproval

func (server *Server) GetOrCreateApproval(ctx context.Context, querier postgres.Querier, p postgres.CreateApprovalParams) (postgres.Approval, error)

func (*Server) GetOrCreateGithubUser

func (server *Server) GetOrCreateGithubUser(ctx context.Context, querier postgres.Querier, p postgres.CreateGithubUserParams) (postgres.GhUser, error)

func (*Server) GetOrCreateInstallation

func (server *Server) GetOrCreateInstallation(ctx context.Context, querier postgres.Querier, id int32) error

func (*Server) GetOrCreatePullRequest

func (server *Server) GetOrCreatePullRequest(ctx context.Context, querier postgres.Querier, p postgres.CreatePullRequestParams) (postgres.PullRequest, error)

func (*Server) GetOrCreatePullRequestAction

func (server *Server) GetOrCreatePullRequestAction(ctx context.Context, querier postgres.Querier, name string) error

func (*Server) GetOrCreateRepo

func (server *Server) GetOrCreateRepo(ctx context.Context, querier postgres.Querier, p postgres.CreateRepoParams) (postgres.Repo, error)

func (*Server) GetQuerier

func (server *Server) GetQuerier() *postgres.Queries

func (*Server) GetRouter

func (server *Server) GetRouter() *mux.Router

func (*Server) PostWebhookEvent

func (server *Server) PostWebhookEvent(w http.ResponseWriter, r *http.Request)

func (*Server) UpdateApproval

func (server *Server) UpdateApproval(w http.ResponseWriter, req *http.Request)

func (*Server) WithPrivateKey

func (server *Server) WithPrivateKey(key *rsa.PrivateKey) *Server

func (*Server) WithRoutes

func (server *Server) WithRoutes() *Server

type UrlEncodedFormAnswers added in v0.0.2

type UrlEncodedFormAnswers struct {
	Data string `json:"data"`
}

Jump to

Keyboard shortcuts

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