Documentation ¶
Index ¶
- func IsImageError(err error) bool
- func IsInvalidRequest(err error) bool
- func IsNoPortAvailable(err error) bool
- func IsSSHNotAvailable(err error) bool
- func IsTunnelError(err error) bool
- type Error
- type ErrorCode
- type Server
- func (s *Server) Done() <-chan struct{}
- func (s *Server) MessageChan() <-chan types.Message
- func (s *Server) Ready() <-chan struct{}
- func (s *Server) SendPostRequest(ctx context.Context, url, key, model string, useStream bool)
- func (s *Server) Shutdown() error
- func (s *Server) Start(ctx context.Context) error
- func (s *Server) TunnelURL() string
- type ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsImageError ¶ added in v0.0.9
IsImageError checks if the error is an image generation error
func IsInvalidRequest ¶ added in v0.0.9
IsInvalidRequest checks if the error is an invalid request error
func IsNoPortAvailable ¶ added in v0.0.9
IsNoPortAvailable checks if the error is a no port available error
func IsSSHNotAvailable ¶ added in v0.0.9
IsSSHNotAvailable checks if the error is an SSH not available error
func IsTunnelError ¶ added in v0.0.9
IsTunnelError checks if the error is a tunnel error
Types ¶
type Error ¶ added in v0.0.9
Error represents a server error
type ErrorCode ¶ added in v0.0.9
type ErrorCode int
ErrorCode represents different types of server errors
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the main application server
func New ¶
func New(cfg *config.Config, opts ...ServerOption) *Server
New creates a new server instance
func (*Server) Done ¶ added in v0.0.9
func (s *Server) Done() <-chan struct{}
Done returns the done channel
func (*Server) MessageChan ¶ added in v0.0.9
MessageChan returns the message channel
func (*Server) SendPostRequest ¶
SendPostRequest sends a POST request to test the API
type ServerOption ¶ added in v0.0.9
type ServerOption func(*Server)
ServerOption represents a server configuration option
func WithHTTPServer ¶ added in v0.0.9
func WithHTTPServer(server interfaces.HTTPServer) ServerOption
WithHTTPServer sets a custom HTTP server
func WithImageGenerator ¶ added in v0.0.9
func WithImageGenerator(ig interfaces.ImageGenerator) ServerOption
WithImageGenerator sets a custom image generator
func WithRouter ¶ added in v0.0.9
func WithRouter(router interfaces.Router) ServerOption
WithRouter sets a custom router
func WithTunnel ¶ added in v0.0.9
func WithTunnel(t interfaces.Tunnel) ServerOption
WithTunnel sets a custom tunnel