Documentation
¶
Index ¶
- Variables
- func Listener(addr string) func() (net.Listener, error)
- func WithListener(lis net.Listener) func() (net.Listener, error)
- type App
- type ListenerFunc
- type Params
- type Server
- func (s *Server) AddDestination(ctx context.Context, req *pb.AddDestinationRequest) (*pb.AddDestinationResponse, error)
- func (s *Server) Communicate(stream pb.InternalAPI_CommunicateServer) error
- func (s *Server) GetClientCount() int
- func (s *Server) ListDestinations(ctx context.Context, req *pb.ListDestinationsRequest) (*pb.ListDestinationsResponse, error)
- func (s *Server) RemoveDestination(ctx context.Context, req *pb.RemoveDestinationRequest) (*pb.RemoveDestinationResponse, error)
- func (s *Server) StartDestination(ctx context.Context, req *pb.StartDestinationRequest) (*pb.StartDestinationResponse, error)
- func (s *Server) StopDestination(ctx context.Context, req *pb.StopDestinationRequest) (*pb.StopDestinationResponse, error)
- func (s *Server) UpdateDestination(ctx context.Context, req *pb.UpdateDestinationRequest) (*pb.UpdateDestinationResponse, error)
- func (s *Server) WaitForClient(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrOtherInstanceDetected = errors.New("another instance is currently running")
ErrOtherInstanceDetected is returned when another instance of the app is detected on startup.
Functions ¶
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is an instance of the app.
func (*App) DispatchAsync ¶
DispatchAsync dispatches a command to be executed synchronously.
func (*App) DispatchSync ¶ added in v0.0.12
DispatchSync dispatches a command to be executed synchronously.
type ListenerFunc ¶
ListenerFunc is a function that returns a net.Listener.
type Params ¶
type Params struct {
Config config.Config
Store *store.FileStore
DockerClient container.DockerClient
ListenerFunc func() (net.Listener, error) // ListenerFunc overrides the configured listen address. May be nil.
ChanSize int
WaitForClient bool
Logger *slog.Logger
}
Params holds the parameters for running the application.
type Server ¶
type Server struct {
pb.UnimplementedInternalAPIServer
// contains filtered or unexported fields
}
Server is the gRPC server that handles incoming commands and outgoing events.
func (*Server) AddDestination ¶ added in v0.0.12
func (s *Server) AddDestination(ctx context.Context, req *pb.AddDestinationRequest) (*pb.AddDestinationResponse, error)
func (*Server) Communicate ¶
func (s *Server) Communicate(stream pb.InternalAPI_CommunicateServer) error
func (*Server) GetClientCount ¶
GetClientCount returns the number of connected clients.
func (*Server) ListDestinations ¶ added in v0.0.12
func (s *Server) ListDestinations(ctx context.Context, req *pb.ListDestinationsRequest) (*pb.ListDestinationsResponse, error)
func (*Server) RemoveDestination ¶ added in v0.0.12
func (s *Server) RemoveDestination(ctx context.Context, req *pb.RemoveDestinationRequest) (*pb.RemoveDestinationResponse, error)
func (*Server) StartDestination ¶ added in v0.0.12
func (s *Server) StartDestination(ctx context.Context, req *pb.StartDestinationRequest) (*pb.StartDestinationResponse, error)
func (*Server) StopDestination ¶ added in v0.0.12
func (s *Server) StopDestination(ctx context.Context, req *pb.StopDestinationRequest) (*pb.StopDestinationResponse, error)
func (*Server) UpdateDestination ¶ added in v0.0.12
func (s *Server) UpdateDestination(ctx context.Context, req *pb.UpdateDestinationRequest) (*pb.UpdateDestinationResponse, error)
Click to show internal directories.
Click to hide internal directories.