server

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: Apache-2.0 Imports: 27 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithNewRunID added in v0.7.1

func ContextWithNewRunID(ctx context.Context) context.Context

func RunIDFromContext added in v0.7.1

func RunIDFromContext(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(closeDaemons bool)

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

func (s SessionFactory) Pause() func()

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