Documentation ¶
Index ¶
- type Callbacker
- type ChanCallback
- type Client
- type ClientOption
- type Enqueuer
- type HTTPCallback
- type HTTPConfig
- type HTTPServer
- type IsolateWorkerProvider
- type Queue
- type Response
- type Server
- type ServerConfig
- type ServerStatus
- type Submission
- type SubmissionStatus
- type Worker
- type WorkerProvider
- type WriterCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callbacker ¶
type ChanCallback ¶
type ChanCallback struct {
// contains filtered or unexported fields
}
func NewChanCallback ¶
func NewChanCallback(c chan Response) *ChanCallback
func (*ChanCallback) Callback ¶
func (cc *ChanCallback) Callback(r Response) error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(url string, opts ...ClientOption) *Client
func (Client) SubmitCallback ¶
func (Client) SubmitStream ¶
func (dc Client) SubmitStream(ctx context.Context, sub Submission, res chan SubmissionStatus) error
type ClientOption ¶
type ClientOption func(*Client)
type HTTPCallback ¶
type HTTPCallback struct {
// contains filtered or unexported fields
}
func NewHTTPCallback ¶
func NewHTTPCallback(url string) HTTPCallback
func (HTTPCallback) Callback ¶
func (h HTTPCallback) Callback(r Response) error
type HTTPConfig ¶
type HTTPServer ¶
type HTTPServer struct { HTTPConfig Enqueuer // contains filtered or unexported fields }
func NewHTTPServer ¶
func NewHTTPServer(cfg HTTPConfig, j Enqueuer, logger *zap.Logger) *HTTPServer
func (*HTTPServer) Run ¶
func (s *HTTPServer) Run() error
func (*HTTPServer) ToString ¶
func (s *HTTPServer) ToString() (string, error)
type IsolateWorkerProvider ¶
type IsolateWorkerProvider struct {
// contains filtered or unexported fields
}
func NewIsolateWorkerProvider ¶
func NewIsolateWorkerProvider(minSandboxId, maxSandboxId, workerCount int) (*IsolateWorkerProvider, error)
func (*IsolateWorkerProvider) Get ¶
func (wp *IsolateWorkerProvider) Get() *Worker
func (*IsolateWorkerProvider) Put ¶
func (wp *IsolateWorkerProvider) Put(w *Worker)
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
func (*Queue) SupportedLanguages ¶
func (*Queue) SupportedProblems ¶
type Server ¶
type Server struct { ServerConfig // contains filtered or unexported fields }
func NewServer ¶
func NewServer(cfg ServerConfig) (*Server, error)
type ServerConfig ¶
type ServerConfig struct { HTTPConfig `mapstructure:",squash"` SandboxIds string `json:"sandbox_ids" mapstructure:"sandbox_ids"` WorkerCount int `json:"worker_count" mapstructure:"worker_count"` ProblemsDir string `json:"problems_dir" mapstructure:"problems_dir"` Mode string `json:"mode" mapstructure:"mode"` }
type ServerStatus ¶
type ServerStatus struct { Host string `json:"host"` Port string `json:"port"` Url string `json:"url"` Load float64 `json:"load"` Uptime time.Duration `json:"uptime"` ProblemList []string `json:"problem_list"` LanguageList []string `json:"language_list"` }
func ParseServerStatus ¶
func ParseServerStatus(s string) (res ServerStatus, err error)
func (ServerStatus) String ¶
func (s ServerStatus) String() string
func (ServerStatus) SupportsLanguage ¶
func (s ServerStatus) SupportsLanguage(want string) bool
func (ServerStatus) SupportsProblem ¶
func (s ServerStatus) SupportsProblem(want string) bool
type Submission ¶
type SubmissionStatus ¶
type WorkerProvider ¶
type WriterCallback ¶
type WriterCallback struct {
// contains filtered or unexported fields
}
func NewWriterCallback ¶
func NewWriterCallback(w io.Writer, afterFunc func()) *WriterCallback
func (*WriterCallback) Callback ¶
func (wc *WriterCallback) Callback(r Response) error
func (*WriterCallback) Error ¶
func (wc *WriterCallback) Error() error
Click to show internal directories.
Click to hide internal directories.