config

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigPath = "~/.95cli/config.json"
View Source
const DefaultAPIURL = "https://api.95ninefive.dev"

DefaultAPIURL is the production API endpoint

View Source
const LocalAPIURL = "http://localhost:8080"

LocalAPIURL is the development API endpoint

Variables

This section is empty.

Functions

func Clear

func Clear() error

func Init

func Init()

func SaveProjectConfig

func SaveProjectConfig(buildCommand, runCommand, language string) error

SaveProjectConfig writes buildCommand, runCommand and language to config.json in the current directory. buildCommand may be empty for interpreted languages.

Types

type Config

type Config struct {
	APIUrl       string `json:"api_url" mapstructure:"api_url"`
	AccessToken  string `json:"access_token" mapstructure:"access_token"`
	RefreshToken string `json:"refresh_token" mapstructure:"refresh_token"`
	UserId       string `json:"user_id" mapstructure:"user_id"`
	Username     string `json:"username" mapstructure:"username"`
}

func Load

func Load() (*Config, error)

func (*Config) GetAPIURL

func (cfg *Config) GetAPIURL() string

GetAPIURL returns the API URL

func (*Config) Save

func (cfg *Config) Save() error

type ProjectConfig

type ProjectConfig struct {
	// BuildCommand is empty for interpreted languages (Python, JS, Ruby, ...).
	// When non-empty, the server runs it inside the submission dir before exec'ing
	// RunCommand, so compiled languages (Go, C, C++, Rust) produce a binary the
	// run step can invoke regardless of the tester's current working directory.
	BuildCommand string `json:"buildCommand,omitempty"`
	RunCommand   string `json:"runCommand"`
	Language     string `json:"language"`
}

func LoadProjectConfig

func LoadProjectConfig() (*ProjectConfig, error)

LoadProjectConfig reads .95cli-project.json from current directory

Jump to

Keyboard shortcuts

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