server

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: Apache-2.0 Imports: 21 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	runner.Event `json:",inline"`
	RunID        string         `json:"runID,omitempty"`
	Program      *types.Program `json:"program,omitempty"`
	Input        string         `json:"input,omitempty"`
	Output       string         `json:"output,omitempty"`
	Err          string         `json:"err,omitempty"`
}

type Options

type Options struct {
	runner.CacheOptions
	runner.OpenAIOptions
	ListenAddress string
}

type Server

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

func New

func New(opts ...Options) (*Server, error)

func (*Server) Connect

func (s *Server) Connect(session *melody.Session)

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(rw http.ResponseWriter, req *http.Request)

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

type Session

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

func (*Session) Event

func (s *Session) Event(event runner.Event)

func (*Session) Stop

func (s *Session) Stop(output string, err error)

type SessionFactory

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

func (SessionFactory) Start

func (s SessionFactory) Start(ctx context.Context, prg *types.Program, env []string, input string) (runner.Monitor, error)

Jump to

Keyboard shortcuts

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