util

package
v0.0.0-...-7c9c7d0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheDir = filepath.Join(HomeDir(), ".cache", "aojtool")

Functions

func EnsurePath

func EnsurePath(path string) (string, error)

func Exists

func Exists(path string) (bool, error)

func FormalLanguage

func FormalLanguage(l string) (string, error)

func HomeDir

func HomeDir() string

func LoadData

func LoadData(path string, data interface{}) error

func ReadFile

func ReadFile(path string) (string, error)

func RemoveContents

func RemoveContents(dirname string) error

func RemoveData

func RemoveData(path string) error

func SaveData

func SaveData(path string, data interface{}) error

func TimeFromUnix

func TimeFromUnix(timestamp int64) time.Time

Types

type ApiError

type ApiError struct {
	ID      int    `json:"id"`
	Code    string `json:"code"`
	Message string `json:"message"`
}

func (ApiError) Error

func (err ApiError) Error() string

type ApiErrors

type ApiErrors []ApiError

func (ApiErrors) Error

func (apiErrors ApiErrors) Error() string

type CodeRunner

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

func NewCodeRunner

func NewCodeRunner(file string, timeout time.Duration) (*CodeRunner, error)

func (*CodeRunner) Run

func (c *CodeRunner) Run(input string) (string, error)

type Language

type Language int
const (
	UnknownLanguage Language = iota
	C
	Cpp
	Java
	Scala
	Haskel
	OCaml
	Cs
	D
	Ruby
	Python
	PHP
	JavaScript
	Rust
	Go
	Kotlin
)

func NewLanguage

func NewLanguage(ext string) Language

Jump to

Keyboard shortcuts

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