src

package
v0.0.0-...-9ec3af4 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile

func Compile(e *Engine, u *Update) (string, error)

func ConstructPayload

func ConstructPayload(code string, language string, versionIndex int) (string, error)

func CreateServer

func CreateServer() error

func Escape

func Escape(s string) string

Escape : Escape special characters like <, >, &, ", ' and /.

func NextProxy

func NextProxy() assets.Proxy

func RedisClient

func RedisClient() (*redis.Client, error)

Types

type Chat

type Chat struct {
	Id int `json:"id"`
}

type CodeOutput

type CodeOutput struct {
	Stdout      string        `json:"stdout"`
	Output      string        `json:"output"`
	ExecTime    float32       `json:"executeTime"`
	Memory      string        `json:"memory"`
	StatusCode  int           `json:"statusCode"`
	OutputFiles []interface{} `json:"outputFiles"`
}

type Engine

type Engine struct {
	RedisClient *redis.Client
}

func NewEngine

func NewEngine() (*Engine, error)

func (*Engine) HandleTelegramWebHook

func (e *Engine) HandleTelegramWebHook(w http.ResponseWriter, r *http.Request)

type HttpClientProvider

type HttpClientProvider struct {
	HttpClient *http.Client
}

func NewCompilerClient

func NewCompilerClient() (*HttpClientProvider, error)

type Message

type Message struct {
	Text string `json:"text"`
	Chat Chat   `json:"chat"`
}

type Request

type Request struct {
	Method   string
	Headers  map[string]string
	FormBody string
	Url      string
}

func NewRequest

func NewRequest(method string, headers map[string]string, formBody string, url string) *Request

func (*Request) Execute

func (r *Request) Execute() (*Response, error)

type Response

type Response struct {
	StatusCode int
	Headers    http.Header
	Body       string
}

func CPlus

func CPlus(code string) (*Response, error)

func Clang

func Clang(code string) (*Response, error)

func Golang

func Golang(code string) (*Response, error)

func Java

func Java(code string) (*Response, error)

func Javascript

func Javascript(code string) (*Response, error)

func Kotlin

func Kotlin(code string) (*Response, error)

func Python

func Python(code string) (*Response, error)

type Update

type Update struct {
	UpdateId int     `json:"update_id"`
	Message  Message `json:"message"`
}

func ParseTelegramRequest

func ParseTelegramRequest(r *http.Request) (*Update, error)

Jump to

Keyboard shortcuts

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