service

package
v0.2.0-beta-8 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorDuplicateRecord          = "duplicate_record"
	ErrorForbidden                = "forbidden"
	ErrorInternalError            = "internal_error"
	ErrorInvalidRequest           = "invalid_request"
	ErrorInvalidParameter         = "invalid_parameter"
	ErrorMissingRequiredParameter = "missing_required_parameter"
	ErrorNotFound                 = "not_found"
	ErrorTokenExpired             = "token_expired"
	ErrorTooManyRequests          = "too_many_requests"
	ErrorUnauthorized             = "unauthorized"
	ErrorUnknownOrigin            = "unknown_origin"
)

Variables

This section is empty.

Functions

func NewGenericError

func NewGenericError(tag string, code string, status int, msg string) *genericError

Types

type DuplicateRecordError

type DuplicateRecordError struct {
	Type string      `json:"type"`
	Key  interface{} `json:"key"`
	// contains filtered or unexported fields
}

DuplicateRecordError type

func NewDuplicateRecordError

func NewDuplicateRecordError(recordType string, recordKey interface{}, reason string) *DuplicateRecordError

func (DuplicateRecordError) Error

func (err DuplicateRecordError) Error() string

func (DuplicateRecordError) GetStatus

func (err DuplicateRecordError) GetStatus() int

func (DuplicateRecordError) GetTag

func (err DuplicateRecordError) GetTag() string

type EmbeddedService

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

EmbeddedService implements the DISReaderService interface for embedded mode.

func NewEmbeddedService

func NewEmbeddedService(config *types.DISConfig, logger *slog.Logger) (*EmbeddedService, error)

NewEmbeddedService creates an embedded DIS reader, starts the JDBC runner, and validates connectivity if credentials are provided.

func (*EmbeddedService) AttachShutdownHook

func (s *EmbeddedService) AttachShutdownHook()

func (*EmbeddedService) Connect

func (s *EmbeddedService) Connect(ctx context.Context) error

func (*EmbeddedService) Disconnect

func (s *EmbeddedService) Disconnect(ctx context.Context) error

func (*EmbeddedService) GetConfig

func (s *EmbeddedService) GetConfig() *types.DISConfig

func (*EmbeddedService) GetLogger

func (s *EmbeddedService) GetLogger() *slog.Logger

func (*EmbeddedService) InvoiceService

func (s *EmbeddedService) InvoiceService() types.InvoiceService

func (*EmbeddedService) PartService

func (s *EmbeddedService) PartService() types.PartService

func (*EmbeddedService) PingDatabase

func (s *EmbeddedService) PingDatabase(ctx context.Context) error

func (*EmbeddedService) PingService

func (s *EmbeddedService) PingService(ctx context.Context) error

func (*EmbeddedService) RunDebugSearch

func (s *EmbeddedService) RunDebugSearch(searchTerm string, opts types.DebugSearchOptions, progressChan chan<- types.ProgressStatus, eventChan chan<- types.TableEvent)

RunDebugSearch executes the debug search batch and streams progress/events.

func (*EmbeddedService) SetLogger

func (s *EmbeddedService) SetLogger(logger *slog.Logger)

func (*EmbeddedService) Shutdown

func (s *EmbeddedService) Shutdown() error

func (*EmbeddedService) UnitService

func (s *EmbeddedService) UnitService() types.UnitService

type Error

type Error interface {
	GetTag() string
	GetStatus() int
}

type ForbiddenError

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

ForbiddenError type

func NewForbiddenError

func NewForbiddenError(msg string) *ForbiddenError

func (ForbiddenError) Error

func (err ForbiddenError) Error() string

func (ForbiddenError) GetStatus

func (err ForbiddenError) GetStatus() int

func (ForbiddenError) GetTag

func (err ForbiddenError) GetTag() string

type InternalError

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

InternalError type

func NewInternalError

func NewInternalError(msg string) *InternalError

func (InternalError) Error

func (err InternalError) Error() string

func (InternalError) GetStatus

func (err InternalError) GetStatus() int

func (InternalError) GetTag

func (err InternalError) GetTag() string

type InvalidParameterError

type InvalidParameterError struct {
	Parameter string `json:"parameter"`
	// contains filtered or unexported fields
}

InvalidParameterError type

func NewInvalidParameterError

func NewInvalidParameterError(paramName string, msg string) *InvalidParameterError

func (*InvalidParameterError) Error

func (err *InvalidParameterError) Error() string

func (InvalidParameterError) GetStatus

func (err InvalidParameterError) GetStatus() int

func (InvalidParameterError) GetTag

func (err InvalidParameterError) GetTag() string

type InvalidRequestError

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

InvalidRequestError type

func NewInvalidRequestError

func NewInvalidRequestError(msg string) *InvalidRequestError

func (InvalidRequestError) Error

func (err InvalidRequestError) Error() string

func (InvalidRequestError) GetStatus

func (err InvalidRequestError) GetStatus() int

func (InvalidRequestError) GetTag

func (err InvalidRequestError) GetTag() string

type MissingRequiredParameterError

type MissingRequiredParameterError struct {
	Parameter string `json:"parameter"`
	// contains filtered or unexported fields
}

MissingRequiredParameterError type

func NewMissingRequiredParameterError

func NewMissingRequiredParameterError(parameterName string) *MissingRequiredParameterError

func (MissingRequiredParameterError) Error

func (err MissingRequiredParameterError) Error() string

func (MissingRequiredParameterError) GetStatus

func (err MissingRequiredParameterError) GetStatus() int

func (MissingRequiredParameterError) GetTag

func (err MissingRequiredParameterError) GetTag() string

type RecordNotFoundError

type RecordNotFoundError struct {
	Type string      `json:"type"`
	Key  interface{} `json:"key"`
	// contains filtered or unexported fields
}

RecordNotFoundError type

func NewRecordNotFoundError

func NewRecordNotFoundError(recordType string, recordKey interface{}) *RecordNotFoundError

func (RecordNotFoundError) Error

func (err RecordNotFoundError) Error() string

func (RecordNotFoundError) GetStatus

func (err RecordNotFoundError) GetStatus() int

func (RecordNotFoundError) GetTag

func (err RecordNotFoundError) GetTag() string

type RemoteService

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

RemoteService implements DISReaderRemote for multi-tenant remote mode.

func NewRemoteService

func NewRemoteService(cfg *types.DISConfig, logger *slog.Logger, multiDB database.MultiTenantDB, registry bridge.AgentRegistry, server *bridge.Server) *RemoteService

func (*RemoteService) Connect

func (s *RemoteService) Connect(ctx context.Context, tenant string) error

func (*RemoteService) Disconnect

func (s *RemoteService) Disconnect(ctx context.Context, tenant string) error

func (*RemoteService) InvoiceService

func (s *RemoteService) InvoiceService(tenant string) types.InvoiceService

func (*RemoteService) PartService

func (s *RemoteService) PartService(tenant string) types.PartService

func (*RemoteService) PingAgent

func (s *RemoteService) PingAgent(ctx context.Context, tenant string) error

PingAgent checks that an agent for the given tenant is available in the registry.

func (*RemoteService) PingBridge

func (s *RemoteService) PingBridge(ctx context.Context) error

PingBridge checks the bridge server/registry availability (tenant-agnostic)

func (*RemoteService) PingDatabase

func (s *RemoteService) PingDatabase(ctx context.Context, tenant string) error

func (*RemoteService) PingService

func (s *RemoteService) PingService(ctx context.Context, tenant string) error

func (*RemoteService) ReadAgentConfig

func (s *RemoteService) ReadAgentConfig(ctx context.Context, tenant string) (*proto.AgentConfigStatus, error)

ReadAgentConfig requests a sanitized snapshot of the agent's current configuration.

func (*RemoteService) RegisterBridge

func (s *RemoteService) RegisterBridge(server *grpc.Server)

Bridge helpers

func (*RemoteService) RegisterHealth

func (s *RemoteService) RegisterHealth(mux *http.ServeMux)

func (*RemoteService) StartJDBCRunner

func (s *RemoteService) StartJDBCRunner(ctx context.Context, tenant string) error

DISReaderRemote implementations

func (*RemoteService) StopJDBCRunner

func (s *RemoteService) StopJDBCRunner(ctx context.Context, tenant string) error

func (*RemoteService) UnitService

func (s *RemoteService) UnitService(tenant string) types.UnitService

func (*RemoteService) UpdateAgentConfig

func (s *RemoteService) UpdateAgentConfig(ctx context.Context, cfg *proto.AgentConfig, tenant string, broadcast bool) error

UpdateAgentConfig lets callers push a fresh AgentConfig to connected agents and update the default used for future agent registrations.

func (*RemoteService) WithDefaultTenant

func (s *RemoteService) WithDefaultTenant(tenant string)

WithDefaultTenant configures the fallback tenant used when a call omits one.

type TokenExpiredError

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

TokenExpiredError type

func NewTokenExpiredError

func NewTokenExpiredError() *TokenExpiredError

func (TokenExpiredError) Error

func (err TokenExpiredError) Error() string

func (TokenExpiredError) GetStatus

func (err TokenExpiredError) GetStatus() int

func (TokenExpiredError) GetTag

func (err TokenExpiredError) GetTag() string

type TooManyRequestsError

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

TooManyRequestsError type

func NewTooManyRequestsError

func NewTooManyRequestsError() *TooManyRequestsError

func (TooManyRequestsError) Error

func (err TooManyRequestsError) Error() string

func (TooManyRequestsError) GetStatus

func (err TooManyRequestsError) GetStatus() int

func (TooManyRequestsError) GetTag

func (err TooManyRequestsError) GetTag() string

type UnauthorizedError

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

UnauthorizedError type

func NewUnauthorizedError

func NewUnauthorizedError(msg string) *UnauthorizedError

func (UnauthorizedError) Error

func (err UnauthorizedError) Error() string

func (UnauthorizedError) GetStatus

func (err UnauthorizedError) GetStatus() int

func (UnauthorizedError) GetTag

func (err UnauthorizedError) GetTag() string

type UnknownOriginError

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

UnknownOriginError type

func NewUnknownOriginError

func NewUnknownOriginError(origin string) *UnknownOriginError

func (UnknownOriginError) Error

func (err UnknownOriginError) Error() string

func (UnknownOriginError) GetStatus

func (err UnknownOriginError) GetStatus() int

func (UnknownOriginError) GetTag

func (err UnknownOriginError) GetTag() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL