Documentation ¶
Overview ¶
Package slcontainer provides the container for the slave node
Index ¶
- Variables
- type Auth
- func (a *Auth) Add(id string, auth auth.SetAuthor)
- func (a Auth) AddFromProto(id string, pbAuth *pb.Auth) error
- func (a Auth) Exists(id string) bool
- func (a Auth) Find(id string) (auth.SetAuthor, bool)
- func (a Auth) GetDefault() auth.SetAuthor
- func (a *Auth) Remove(id string)
- func (a *Auth) SetDefault(id string)
- type AuthResourceRequest
- type CommandMapData
- type Encryption
- type Loader
- type LoaderResourceRequest
- type ReceiveChanelRequestContainer
- func (r *ReceiveChanelRequestContainer) Cast(reqID string)
- func (r *ReceiveChanelRequestContainer) SendAuthResourceRequests(ctx context.Context, connectionID string, mapper *RequestConnectionMapper, ...) <-chan struct{}
- func (r *ReceiveChanelRequestContainer) SendLoaderResourceRequests(ctx context.Context, connectionID string, mapper *RequestConnectionMapper, ...) <-chan struct{}
- func (r *ReceiveChanelRequestContainer) SendStore(ctx context.Context, connectionID string, mapper *RequestConnectionMapper, ...) (<-chan struct{}, error)
- func (r *ReceiveChanelRequestContainer) SendStoreResourceRequests(ctx context.Context, connectionID string, mapper *RequestConnectionMapper, ...) (<-chan struct{}, error)
- func (r *ReceiveChanelRequestContainer) SendTargetResourceRequests(ctx context.Context, connectionID string, mapper *RequestConnectionMapper, ...) <-chan struct{}
- type RequestConnectionMapper
- func (r *RequestConnectionMapper) DeleteRequest(reqID string)
- func (r *RequestConnectionMapper) DeleteRequestConnection(connectionID string)
- func (r *RequestConnectionMapper) GetConnectionID(reqID string) (string, bool)
- func (r *RequestConnectionMapper) GetRequestID(connectionID string) ([]string, bool)
- func (r *RequestConnectionMapper) RegisterRequestConnection(reqID, connectionID string)
- type RequestTermCaster
- type SlaveContainer
- func (s *SlaveContainer) AddCommandMap(cmdID string, data CommandMapData)
- func (s *SlaveContainer) DeleteCommandMap(cmdID string)
- func (s *SlaveContainer) GetCommandMap(cmdID string) (CommandMapData, bool)
- func (s *SlaveContainer) SetSlaveValues(cmdID string, slaveValues map[string]any) error
- func (s *SlaveContainer) SetStrMap(cmdID string, strMap map[string]any) error
- func (s *SlaveContainer) SetThreadOnlyStrMap(cmdID string, strMap map[string]any) error
- type Store
- type StoreData
- type StoreDataKey
- type StoreDataRequest
- type StoreResourceRequest
- type StoreRespectiveRequest
- type Target
- type TargetResourceRequest
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidLoaderID is returned when the loader id is invalid ErrInvalidLoaderID = fmt.Errorf("invalid loader id") // ErrInvalidAuthID is returned when the auth id is invalid ErrInvalidAuthID = fmt.Errorf("invalid auth id") // ErrRequestNotFound is returned when the request is not found ErrRequestNotFound = fmt.Errorf("request not found") // ErrInvalidAuthType is returned when the auth type is invalid ErrInvalidAuthType = fmt.Errorf("invalid auth type") )
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct { DefaultAuthenticator string Container map[string]*auth.SetAuthor // contains filtered or unexported fields }
Auth is the struct to store auth information
func (Auth) AddFromProto ¶
AddFromProto adds a new auth from the proto to the container
type AuthResourceRequest ¶
AuthResourceRequest is the struct to store auth resource request
type CommandMapData ¶
type CommandMapData struct { LoaderID string OutputRoot string StrMap *sync.Map ThreadOnlyStrMap *sync.Map SlaveValues map[string]any }
CommandMapData represents the data for the command map
type Encryption ¶
type Encryption struct { // Enabled is the flag to enable encryption Enabled bool // EncryptID is the encryption id EncryptID string }
Encryption is the struct to store encryption information
type Loader ¶
type Loader struct { LoaderBuilderMap map[string]*strings.Builder LoaderMap map[string]string // contains filtered or unexported fields }
Loader represents the loader container for the slave node
func NewLoader ¶
func NewLoader() *Loader
NewLoader creates a new loader container for the slave node
func (*Loader) WriteString ¶
WriteString writes a string to the loader container
type LoaderResourceRequest ¶
type LoaderResourceRequest struct {
LoaderID string
}
LoaderResourceRequest is a struct that represents a request to the loader resource.
type ReceiveChanelRequestContainer ¶
type ReceiveChanelRequestContainer struct { ReqChan chan *pb.ReceiveChanelConnectResponse // contains filtered or unexported fields }
ReceiveChanelRequestContainer is a struct that represents a container for the receive chanel requests
func NewReceiveChanelRequestContainer ¶
func NewReceiveChanelRequestContainer() *ReceiveChanelRequestContainer
NewReceiveChanelRequestContainer creates a new request container
func (*ReceiveChanelRequestContainer) Cast ¶
func (r *ReceiveChanelRequestContainer) Cast(reqID string)
Cast casts a term to the request
func (*ReceiveChanelRequestContainer) SendAuthResourceRequests ¶
func (r *ReceiveChanelRequestContainer) SendAuthResourceRequests( ctx context.Context, connectionID string, mapper *RequestConnectionMapper, req AuthResourceRequest, ) <-chan struct{}
SendAuthResourceRequests sets the auth requests channel
func (*ReceiveChanelRequestContainer) SendLoaderResourceRequests ¶
func (r *ReceiveChanelRequestContainer) SendLoaderResourceRequests( ctx context.Context, connectionID string, mapper *RequestConnectionMapper, req LoaderResourceRequest, ) <-chan struct{}
SendLoaderResourceRequests sets the loader requests channel
func (*ReceiveChanelRequestContainer) SendStore ¶
func (r *ReceiveChanelRequestContainer) SendStore( ctx context.Context, connectionID string, mapper *RequestConnectionMapper, req StoreDataRequest, ) (<-chan struct{}, error)
SendStore send store requests
func (*ReceiveChanelRequestContainer) SendStoreResourceRequests ¶
func (r *ReceiveChanelRequestContainer) SendStoreResourceRequests( ctx context.Context, connectionID string, mapper *RequestConnectionMapper, req StoreResourceRequest, ) (<-chan struct{}, error)
SendStoreResourceRequests sets the store requests channel
func (*ReceiveChanelRequestContainer) SendTargetResourceRequests ¶
func (r *ReceiveChanelRequestContainer) SendTargetResourceRequests( ctx context.Context, connectionID string, mapper *RequestConnectionMapper, req TargetResourceRequest, ) <-chan struct{}
SendTargetResourceRequests sets the target requests channel
type RequestConnectionMapper ¶
type RequestConnectionMapper struct {
// contains filtered or unexported fields
}
RequestConnectionMapper is a struct that represents a request connection mapper
func NewRequestConnectionMapper ¶
func NewRequestConnectionMapper() *RequestConnectionMapper
NewRequestConnectionMapper creates a new request connection mapper
func (*RequestConnectionMapper) DeleteRequest ¶
func (r *RequestConnectionMapper) DeleteRequest(reqID string)
DeleteRequest deletes the request from the mapper
func (*RequestConnectionMapper) DeleteRequestConnection ¶
func (r *RequestConnectionMapper) DeleteRequestConnection(connectionID string)
DeleteRequestConnection deletes the request connection from the mapper
func (*RequestConnectionMapper) GetConnectionID ¶
func (r *RequestConnectionMapper) GetConnectionID(reqID string) (string, bool)
GetConnectionID returns the connection ID for the request
func (*RequestConnectionMapper) GetRequestID ¶
func (r *RequestConnectionMapper) GetRequestID(connectionID string) ([]string, bool)
GetRequestID returns the request ID for the connection
func (*RequestConnectionMapper) RegisterRequestConnection ¶
func (r *RequestConnectionMapper) RegisterRequestConnection(reqID, connectionID string)
RegisterRequestConnection registers a new request connection to the mapper
type RequestTermCaster ¶
type RequestTermCaster struct {
// contains filtered or unexported fields
}
RequestTermCaster is an interface that represents a request term caster
func NewRequestTermCaster ¶
func NewRequestTermCaster() *RequestTermCaster
NewRequestTermCaster creates a new request term caster
func (*RequestTermCaster) Cast ¶
func (r *RequestTermCaster) Cast(reqID string)
Cast casts a term to the request
func (*RequestTermCaster) RegisterRequest ¶
func (r *RequestTermCaster) RegisterRequest(reqID string) <-chan struct{}
RegisterRequest registers a new request to the caster
type SlaveContainer ¶
type SlaveContainer struct { Auth *Auth Store *Store Target *Target Loader *Loader CommandMap *sync.Map ReceiveChanelRequestContainer *ReceiveChanelRequestContainer }
SlaveContainer represents the container for the slave node
func NewSlaveContainer ¶
func NewSlaveContainer() *SlaveContainer
NewSlaveContainer creates a new container for the slave node
func (*SlaveContainer) AddCommandMap ¶
func (s *SlaveContainer) AddCommandMap(cmdID string, data CommandMapData)
AddCommandMap adds a command map to the slave container
func (*SlaveContainer) DeleteCommandMap ¶
func (s *SlaveContainer) DeleteCommandMap(cmdID string)
DeleteCommandMap deletes the command map from the slave container
func (*SlaveContainer) GetCommandMap ¶
func (s *SlaveContainer) GetCommandMap(cmdID string) (CommandMapData, bool)
GetCommandMap returns the command map from the slave container
func (*SlaveContainer) SetSlaveValues ¶
func (s *SlaveContainer) SetSlaveValues(cmdID string, slaveValues map[string]any) error
SetSlaveValues sets the slave values for the command map
func (*SlaveContainer) SetStrMap ¶
func (s *SlaveContainer) SetStrMap(cmdID string, strMap map[string]any) error
SetStrMap sets the str map for the command map
func (*SlaveContainer) SetThreadOnlyStrMap ¶
func (s *SlaveContainer) SetThreadOnlyStrMap(cmdID string, strMap map[string]any) error
SetThreadOnlyStrMap sets the thread only str map for the command map
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the interface to store the data
func (*Store) RemoveData ¶
RemoveData removes the data from the store
type StoreData ¶
type StoreData struct { BucketID string StoreKey string Data []byte Encryption Encryption }
StoreData is the struct to store the store data
type StoreDataKey ¶
StoreDataKey is the struct to store the store data key
type StoreDataRequest ¶
type StoreDataRequest struct {
StoreData []StoreData
}
StoreDataRequest is the struct to store the store data request
type StoreResourceRequest ¶
type StoreResourceRequest struct {
Requests []StoreRespectiveRequest
}
StoreResourceRequest is the struct to store the store resource request
type StoreRespectiveRequest ¶
type StoreRespectiveRequest struct { BucketID string StoreKey string Encryption Encryption }
StoreRespectiveRequest is the struct to store the store respective request
type Target ¶
Target represents the target container for the slave node
func NewTarget ¶
func NewTarget() *Target
NewTarget creates a new target container for the slave node
func (Target) AddFromProto ¶
AddFromProto adds a new target from the proto to the container
type TargetResourceRequest ¶
type TargetResourceRequest struct {
TargetID string
}
TargetResourceRequest represents a target resource request