internal/grpcv1Legend: Type, Function, Method
Package: package grpcv1 // import "github.com/smysnk/sikuligo/internal/grpcv1"
MethodSnapshotMetricsRegistryMetricsSnapshotMetricsSnapshotProviderServerServerOptionSessionTrackerStoreMetricsProviderNewAdminMuxStreamInterceptorsUnaryInterceptorsNewMetricsRegistryNewServerWithCaptureScreenWithClickOnScreenWithFinderFactoryWithFinderWithEngineFactoryWithScreenListerNewSessionTrackerNewStoreMetricsProviderMetricsRegistry.FinishRequestMetricsRegistry.RecordMetricsRegistry.RecordAuthFailureMetricsRegistry.SnapshotMetricsRegistry.StartRequestServer.CaptureScreenServer.ClickServer.ClickOnScreenServer.CloseAppServer.ExistsOnScreenServer.FindServer.FindAllServer.FindOnScreenServer.FindTextServer.FindWindowsServer.FocusAppServer.GetFocusedWindowServer.GetPrimaryScreenServer.GetWindowServer.HotkeyServer.IsAppRunningServer.KeyDownServer.KeyUpServer.ListScreensServer.ListWindowsServer.MouseDownServer.MouseUpServer.MoveMouseServer.ObserveAppearServer.ObserveChangeServer.ObserveVanishServer.OpenAppServer.PasteTextServer.ReadTextServer.ScrollWheelServer.TypeTextServer.WaitOnScreenSessionTracker.HandleConnSessionTracker.HandleRPCSessionTracker.RecordInteractionSessionTracker.TagConnSessionTracker.TagRPCStoreMetricsProvider.SnapshotMethodSnapshottype MethodSnapshot struct {MetricsRegistrytype MetricsRegistry struct {MetricsSnapshottype MetricsSnapshot struct {MetricsSnapshotProvidertype MetricsSnapshotProvider interface {Servertype Server struct {ServerOptiontype ServerOption func(*Server)ServerSessionTrackertype SessionTracker struct {StoreMetricsProvidertype StoreMetricsProvider struct {NewAdminMuxfunc NewAdminMux(provider MetricsSnapshotProvider, store *sessionstore.Store) *http.ServeMuxMetricsSnapshotProviderStreamInterceptorsfunc StreamInterceptors(authToken string, logger *log.Logger, metrics *MetricsRegistry, tracker *SessionTracker) []grpc.StreamServerInterceptorMetricsRegistry, SessionTrackerUnaryInterceptorsfunc UnaryInterceptors(authToken string, logger *log.Logger, metrics *MetricsRegistry, tracker *SessionTracker) []grpc.UnaryServerInterceptorMetricsRegistry, SessionTrackerNewMetricsRegistryfunc NewMetricsRegistry() *MetricsRegistryMetricsRegistryNewServerfunc NewServer(opts ...ServerOption) *ServerServer, ServerOptionWithCaptureScreenfunc WithCaptureScreen(fn func(context.Context, string) (*sikuli.Image, error)) ServerOptionServerOptionWithClickOnScreenfunc WithClickOnScreen(fn func(int, int, sikuli.InputOptions) error) ServerOptionServerOptionWithFinderFactoryfunc WithFinderFactory(fn func(*sikuli.Image) (*sikuli.Finder, error)) ServerOptionServerOptionWithFinderWithEngineFactoryfunc WithFinderWithEngineFactory(fn func(*sikuli.Image, cv.MatcherEngine) (*sikuli.Finder, error)) ServerOptionServerOptionWithScreenListerfunc WithScreenLister(fn func(context.Context) ([]sikuli.Screen, error)) ServerOptionServerOptionNewSessionTrackerfunc NewSessionTracker(store *sessionstore.Store, apiSessionID uint, logger *log.Logger) *SessionTrackerSessionTrackerNewStoreMetricsProviderfunc NewStoreMetricsProvider(store *sessionstore.Store) *StoreMetricsProviderStoreMetricsProviderMetricsRegistry.FinishRequestfunc (m *MetricsRegistry) FinishRequest()MetricsRegistry.Recordfunc (m *MetricsRegistry) Record(method string, code codes.Code, latency time.Duration, traceID string)MetricsRegistry.RecordAuthFailurefunc (m *MetricsRegistry) RecordAuthFailure(method string)MetricsRegistry.Snapshotfunc (m *MetricsRegistry) Snapshot() MetricsSnapshotMetricsSnapshotMetricsRegistry.StartRequestfunc (m *MetricsRegistry) StartRequest()Server.CaptureScreenfunc (s *Server) CaptureScreen(ctx context.Context, req *pb.CaptureScreenRequest) (*pb.CaptureScreenResponse, error)Server.Clickfunc (s *Server) Click(_ context.Context, req *pb.ClickRequest) (*pb.ActionResponse, error)Server.ClickOnScreenfunc (s *Server) ClickOnScreen(ctx context.Context, req *pb.ClickOnScreenRequest) (*pb.FindResponse, error)Server.CloseAppfunc (s *Server) CloseApp(_ context.Context, req *pb.AppActionRequest) (*pb.ActionResponse, error)Server.ExistsOnScreenfunc (s *Server) ExistsOnScreen(ctx context.Context, req *pb.ExistsOnScreenRequest) (*pb.ExistsOnScreenResponse, error)Server.Findfunc (s *Server) Find(ctx context.Context, req *pb.FindRequest) (*pb.FindResponse, error)Server.FindAllfunc (s *Server) FindAll(ctx context.Context, req *pb.FindRequest) (*pb.FindAllResponse, error)Server.FindOnScreenfunc (s *Server) FindOnScreen(ctx context.Context, req *pb.FindOnScreenRequest) (*pb.FindResponse, error)Server.FindTextfunc (s *Server) FindText(_ context.Context, req *pb.FindTextRequest) (*pb.FindTextResponse, error)Server.FindWindowsfunc (s *Server) FindWindows(_ context.Context, req *pb.WindowQueryRequest) (*pb.ListWindowsResponse, error)Server.FocusAppfunc (s *Server) FocusApp(_ context.Context, req *pb.AppActionRequest) (*pb.ActionResponse, error)Server.GetFocusedWindowfunc (s *Server) GetFocusedWindow(_ context.Context, req *pb.AppActionRequest) (*pb.GetWindowResponse, error)Server.GetPrimaryScreenfunc (s *Server) GetPrimaryScreen(ctx context.Context, _ *pb.GetPrimaryScreenRequest) (*pb.GetPrimaryScreenResponse, error)Server.GetWindowfunc (s *Server) GetWindow(_ context.Context, req *pb.WindowQueryRequest) (*pb.GetWindowResponse, error)Server.Hotkeyfunc (s *Server) Hotkey(_ context.Context, req *pb.HotkeyRequest) (*pb.ActionResponse, error)Server.IsAppRunningfunc (s *Server) IsAppRunning(_ context.Context, req *pb.AppActionRequest) (*pb.IsAppRunningResponse, error)Server.KeyDownfunc (s *Server) KeyDown(_ context.Context, req *pb.HotkeyRequest) (*pb.ActionResponse, error)Server.KeyUpfunc (s *Server) KeyUp(_ context.Context, req *pb.HotkeyRequest) (*pb.ActionResponse, error)Server.ListScreensfunc (s *Server) ListScreens(ctx context.Context, _ *pb.ListScreensRequest) (*pb.ListScreensResponse, error)Server.ListWindowsfunc (s *Server) ListWindows(_ context.Context, req *pb.AppActionRequest) (*pb.ListWindowsResponse, error)Server.MouseDownfunc (s *Server) MouseDown(_ context.Context, req *pb.ClickRequest) (*pb.ActionResponse, error)Server.MouseUpfunc (s *Server) MouseUp(_ context.Context, req *pb.ClickRequest) (*pb.ActionResponse, error)Server.MoveMousefunc (s *Server) MoveMouse(_ context.Context, req *pb.MoveMouseRequest) (*pb.ActionResponse, error)Server.ObserveAppearfunc (s *Server) ObserveAppear(_ context.Context, req *pb.ObserveRequest) (*pb.ObserveResponse, error)Server.ObserveChangefunc (s *Server) ObserveChange(_ context.Context, req *pb.ObserveChangeRequest) (*pb.ObserveResponse, error)Server.ObserveVanishfunc (s *Server) ObserveVanish(_ context.Context, req *pb.ObserveRequest) (*pb.ObserveResponse, error)Server.OpenAppfunc (s *Server) OpenApp(_ context.Context, req *pb.AppActionRequest) (*pb.ActionResponse, error)Server.PasteTextfunc (s *Server) PasteText(_ context.Context, req *pb.TypeTextRequest) (*pb.ActionResponse, error)Server.ReadTextfunc (s *Server) ReadText(_ context.Context, req *pb.ReadTextRequest) (*pb.ReadTextResponse, error)Server.ScrollWheelfunc (s *Server) ScrollWheel(_ context.Context, req *pb.ScrollWheelRequest) (*pb.ActionResponse, error)Server.TypeTextfunc (s *Server) TypeText(_ context.Context, req *pb.TypeTextRequest) (*pb.ActionResponse, error)Server.WaitOnScreenfunc (s *Server) WaitOnScreen(ctx context.Context, req *pb.WaitOnScreenRequest) (*pb.FindResponse, error)SessionTracker.HandleConnfunc (s *SessionTracker) HandleConn(ctx context.Context, conn stats.ConnStats)SessionTracker.HandleRPCfunc (s *SessionTracker) HandleRPC(context.Context, stats.RPCStats)SessionTracker.RecordInteractionfunc (s *SessionTracker) RecordInteraction(ctx context.Context, method string, code codes.Code, duration time.Duration, traceID string)SessionTracker.TagConnfunc (s *SessionTracker) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.ContextSessionTracker.TagRPCfunc (s *SessionTracker) TagRPC(ctx context.Context, _ *stats.RPCTagInfo) context.ContextStoreMetricsProvider.Snapshotfunc (p *StoreMetricsProvider) Snapshot() MetricsSnapshotMetricsSnapshotpackage grpcv1 // import "github.com/smysnk/sikuligo/internal/grpcv1"
FUNCTIONS
func NewAdminMux(provider MetricsSnapshotProvider, store *sessionstore.Store) *http.ServeMux
func StreamInterceptors(authToken string, logger *log.Logger, metrics *MetricsRegistry, tracker *SessionTracker) []grpc.StreamServerInterceptor
func UnaryInterceptors(authToken string, logger *log.Logger, metrics *MetricsRegistry, tracker *SessionTracker) []grpc.UnaryServerInterceptor
TYPES
type MethodSnapshot struct {
Method string `json:"method"`
Requests uint64 `json:"requests"`
Errors uint64 `json:"errors"`
AuthFailures uint64 `json:"auth_failures"`
AvgLatencyMS float64 `json:"avg_latency_ms"`
MaxLatencyMS float64 `json:"max_latency_ms"`
LastCode string `json:"last_code"`
LastTraceID string `json:"last_trace_id"`
LastSeenUnixMS int64 `json:"last_seen_unix_ms"`
LastSeenRFC3339 string `json:"last_seen_rfc3339"`
ErrorRatePercent float64 `json:"error_rate_percent"`
}
type MetricsRegistry struct {
// Has unexported fields.
}
func NewMetricsRegistry() *MetricsRegistry
func (m *MetricsRegistry) FinishRequest()
func (m *MetricsRegistry) Record(method string, code codes.Code, latency time.Duration, traceID string)
func (m *MetricsRegistry) RecordAuthFailure(method string)
func (m *MetricsRegistry) Snapshot() MetricsSnapshot
func (m *MetricsRegistry) StartRequest()
type MetricsSnapshot struct {
StartedAtRFC3339 string `json:"started_at_rfc3339"`
UptimeSeconds int64 `json:"uptime_seconds"`
Inflight int64 `json:"inflight"`
TotalRequests uint64 `json:"total_requests"`
TotalErrors uint64 `json:"total_errors"`
TotalAuthFailures uint64 `json:"total_auth_failures"`
Methods []MethodSnapshot `json:"methods"`
}
type MetricsSnapshotProvider interface {
Snapshot() MetricsSnapshot
}
type Server struct {
pb.UnimplementedSikuliServiceServer
// Has unexported fields.
}
func NewServer(opts ...ServerOption) *Server
func (s *Server) CaptureScreen(ctx context.Context, req *pb.CaptureScreenRequest) (*pb.CaptureScreenResponse, error)
func (s *Server) Click(_ context.Context, req *pb.ClickRequest) (*pb.ActionResponse, error)
func (s *Server) ClickOnScreen(ctx context.Context, req *pb.ClickOnScreenRequest) (*pb.FindResponse, error)
func (s *Server) CloseApp(_ context.Context, req *pb.AppActionRequest) (*pb.ActionResponse, error)
func (s *Server) ExistsOnScreen(ctx context.Context, req *pb.ExistsOnScreenRequest) (*pb.ExistsOnScreenResponse, error)
func (s *Server) Find(ctx context.Context, req *pb.FindRequest) (*pb.FindResponse, error)
func (s *Server) FindAll(ctx context.Context, req *pb.FindRequest) (*pb.FindAllResponse, error)
func (s *Server) FindOnScreen(ctx context.Context, req *pb.FindOnScreenRequest) (*pb.FindResponse, error)
func (s *Server) FindText(_ context.Context, req *pb.FindTextRequest) (*pb.FindTextResponse, error)
func (s *Server) FindWindows(_ context.Context, req *pb.WindowQueryRequest) (*pb.ListWindowsResponse, error)
func (s *Server) FocusApp(_ context.Context, req *pb.AppActionRequest) (*pb.ActionResponse, error)
func (s *Server) GetFocusedWindow(_ context.Context, req *pb.AppActionRequest) (*pb.GetWindowResponse, error)
func (s *Server) GetPrimaryScreen(ctx context.Context, _ *pb.GetPrimaryScreenRequest) (*pb.GetPrimaryScreenResponse, error)
func (s *Server) GetWindow(_ context.Context, req *pb.WindowQueryRequest) (*pb.GetWindowResponse, error)
func (s *Server) Hotkey(_ context.Context, req *pb.HotkeyRequest) (*pb.ActionResponse, error)
func (s *Server) IsAppRunning(_ context.Context, req *pb.AppActionRequest) (*pb.IsAppRunningResponse, error)
func (s *Server) KeyDown(_ context.Context, req *pb.HotkeyRequest) (*pb.ActionResponse, error)
func (s *Server) KeyUp(_ context.Context, req *pb.HotkeyRequest) (*pb.ActionResponse, error)
func (s *Server) ListScreens(ctx context.Context, _ *pb.ListScreensRequest) (*pb.ListScreensResponse, error)
func (s *Server) ListWindows(_ context.Context, req *pb.AppActionRequest) (*pb.ListWindowsResponse, error)
func (s *Server) MouseDown(_ context.Context, req *pb.ClickRequest) (*pb.ActionResponse, error)
func (s *Server) MouseUp(_ context.Context, req *pb.ClickRequest) (*pb.ActionResponse, error)
func (s *Server) MoveMouse(_ context.Context, req *pb.MoveMouseRequest) (*pb.ActionResponse, error)
func (s *Server) ObserveAppear(_ context.Context, req *pb.ObserveRequest) (*pb.ObserveResponse, error)
func (s *Server) ObserveChange(_ context.Context, req *pb.ObserveChangeRequest) (*pb.ObserveResponse, error)
func (s *Server) ObserveVanish(_ context.Context, req *pb.ObserveRequest) (*pb.ObserveResponse, error)
func (s *Server) OpenApp(_ context.Context, req *pb.AppActionRequest) (*pb.ActionResponse, error)
func (s *Server) PasteText(_ context.Context, req *pb.TypeTextRequest) (*pb.ActionResponse, error)
func (s *Server) ReadText(_ context.Context, req *pb.ReadTextRequest) (*pb.ReadTextResponse, error)
func (s *Server) ScrollWheel(_ context.Context, req *pb.ScrollWheelRequest) (*pb.ActionResponse, error)
func (s *Server) TypeText(_ context.Context, req *pb.TypeTextRequest) (*pb.ActionResponse, error)
func (s *Server) WaitOnScreen(ctx context.Context, req *pb.WaitOnScreenRequest) (*pb.FindResponse, error)
type ServerOption func(*Server)
func WithCaptureScreen(fn func(context.Context, string) (*sikuli.Image, error)) ServerOption
func WithClickOnScreen(fn func(int, int, sikuli.InputOptions) error) ServerOption
func WithFinderFactory(fn func(*sikuli.Image) (*sikuli.Finder, error)) ServerOption
func WithFinderWithEngineFactory(fn func(*sikuli.Image, cv.MatcherEngine) (*sikuli.Finder, error)) ServerOption
func WithScreenLister(fn func(context.Context) ([]sikuli.Screen, error)) ServerOption
type SessionTracker struct {
// Has unexported fields.
}
func NewSessionTracker(store *sessionstore.Store, apiSessionID uint, logger *log.Logger) *SessionTracker
func (s *SessionTracker) HandleConn(ctx context.Context, conn stats.ConnStats)
func (s *SessionTracker) HandleRPC(context.Context, stats.RPCStats)
func (s *SessionTracker) RecordInteraction(ctx context.Context, method string, code codes.Code, duration time.Duration, traceID string)
func (s *SessionTracker) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context
func (s *SessionTracker) TagRPC(ctx context.Context, _ *stats.RPCTagInfo) context.Context
type StoreMetricsProvider struct {
// Has unexported fields.
}
func NewStoreMetricsProvider(store *sessionstore.Store) *StoreMetricsProvider
func (p *StoreMetricsProvider) Snapshot() MetricsSnapshot