handlers

package
v0.0.0-...-6d1408b Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthHandler

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

func NewAuthHandler

func NewAuthHandler(
	databaseService *services.DatabaseService,
	githubService *services.GithubService,
	gitlabService *services.GitlabService,
	tokenService *services.TokenService,
) (*AuthHandler, error)

func (*AuthHandler) Check

func (h *AuthHandler) Check(c echo.Context) error

/auth/check

func (*AuthHandler) LoginGithub

func (h *AuthHandler) LoginGithub(c echo.Context) error

POST /auth/login/github

func (*AuthHandler) LoginGitlab

func (h *AuthHandler) LoginGitlab(c echo.Context) error

POST /auth/login/gitlab

func (*AuthHandler) RevokeGithub

func (h *AuthHandler) RevokeGithub(c echo.Context) error

POST /auth/revoke/github

func (*AuthHandler) RevokeGitlab

func (h *AuthHandler) RevokeGitlab(c echo.Context) error

POST /auth/revoke/gitlab

type PaginatedMeta

type PaginatedMeta struct {
	ItemCount    int `json:"item_count"`
	TotalItems   int `json:"total_items"`
	ItemsPerPage int `json:"items_per_page"`
	TotalPages   int `json:"total_pages"`
	CurrentPage  int `json:"current_page"`
}

type PaginatedResponse

type PaginatedResponse[T any] struct {
	Items []T           `json:"items"`
	Meta  PaginatedMeta `json:"meta"`
}

type StripeWebhooksHandler

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

func NewStripeWebhooksHandler

func NewStripeWebhooksHandler(databaseService *services.DatabaseService, subscriptionService *services.SubscriptionService, endpointSecret string) (*StripeWebhooksHandler, error)

func (*StripeWebhooksHandler) HandleWebhooks

func (h *StripeWebhooksHandler) HandleWebhooks(c echo.Context) error

type SubmissionsHandler

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

func NewSubmissionsHandler

func NewSubmissionsHandler(databaseService *services.DatabaseService, tokenService *services.TokenService, storageService *services.StorageService) (*SubmissionsHandler, error)

func (*SubmissionsHandler) DeleteSubmission

func (h *SubmissionsHandler) DeleteSubmission(c echo.Context) error

DELETE /submissions/:id

func (*SubmissionsHandler) UpdateSubmissionVisibility

func (h *SubmissionsHandler) UpdateSubmissionVisibility(c echo.Context) error

PATCH /submissions/:id/visibility

type SubscriptionHandler

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

func NewSubscriptionHandler

func NewSubscriptionHandler(databaseService *services.DatabaseService, tokenService *services.TokenService, subscriptionService *services.SubscriptionService) (*SubscriptionHandler, error)

func (*SubscriptionHandler) CreateCheckoutSession

func (h *SubscriptionHandler) CreateCheckoutSession(c echo.Context) error

POST /subscription/checkout

func (*SubscriptionHandler) CreatePortalSession

func (h *SubscriptionHandler) CreatePortalSession(c echo.Context) error

POST /subscription/portal

type TranspilationHandler

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

func NewTranspilationHandler

func NewTranspilationHandler(storageService *services.StorageService, databaseService *services.DatabaseService, tokenService *services.TokenService, submissionService *services.SubmissionService) (*TranspilationHandler, error)

func (*TranspilationHandler) DownloadInlineTranspilationSource

func (h *TranspilationHandler) DownloadInlineTranspilationSource(c echo.Context) error

GET /submissions/:id/inline/source

func (*TranspilationHandler) DownloadInlineTranspiledOutput

func (h *TranspilationHandler) DownloadInlineTranspiledOutput(c echo.Context) error

GET /submissions/:id/inline/output

func (*TranspilationHandler) DownloadTranspiledFiles

func (h *TranspilationHandler) DownloadTranspiledFiles(c echo.Context) error

GET /submissions/:id/download

func (*TranspilationHandler) Transpile

func (h *TranspilationHandler) Transpile(c echo.Context, transpilationType TranspilationType) error

func (*TranspilationHandler) TranspileGit

func (h *TranspilationHandler) TranspileGit(c echo.Context) error

func (*TranspilationHandler) TranspileInline

func (h *TranspilationHandler) TranspileInline(c echo.Context) error

func (*TranspilationHandler) TranspileZip

func (h *TranspilationHandler) TranspileZip(c echo.Context) error

type TranspilationResult

type TranspilationResult struct {
	ID             string `json:"id"`
	SourceLanguage string `json:"source_language"`
	TargetLanguage string `json:"target_language"`
	Status         string `json:"status"`
	Reason         string `json:"reason"`
	CreatedAt      string `json:"created_at"`
}

type TranspilationType

type TranspilationType int64
const (
	UndefinedTranspilationType TranspilationType = iota
	InlineTranspilationType
	ZipTranspilationType
	GitTranspilationType
)

type UserHandler

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

func NewUserHandler

func NewUserHandler(databaseService *services.DatabaseService, tokenService *services.TokenService, subscriptionService *services.SubscriptionService, storageService *services.StorageService) (*UserHandler, error)

func (*UserHandler) DeleteCurrentUser

func (h *UserHandler) DeleteCurrentUser(c echo.Context) error

DELETE /users/me

func (*UserHandler) GetCurrentUser

func (h *UserHandler) GetCurrentUser(c echo.Context) error

GET /users/me

func (*UserHandler) GetCurrentUserLinkedAccounts

func (h *UserHandler) GetCurrentUserLinkedAccounts(c echo.Context) error

GET /users/me/linked-accounts

func (*UserHandler) GetExport

func (h *UserHandler) GetExport(c echo.Context) error

GET /users/me/export

func (*UserHandler) GetSubmissionsHistory

func (h *UserHandler) GetSubmissionsHistory(c echo.Context) error

GET /users/me/submissions

Jump to

Keyboard shortcuts

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