server

package
v0.5.1-rc2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 25 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithNewID added in v0.1.5

func ContextWithNewID(ctx context.Context) context.Context

func IDFromContext added in v0.1.5

func IDFromContext(ctx context.Context) string

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 {
	ListenAddress string
	GPTScript     gptscript.Options
}

type Server

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

func New

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

func (*Server) Close added in v0.3.0

func (s *Server) Close()

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) Pause added in v0.5.0

func (s *Session) Pause() func()

func (*Session) Stop

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

type SessionFactory

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

func NewSessionFactory added in v0.1.5

func NewSessionFactory(events *broadcaster.Broadcaster[Event]) *SessionFactory

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