Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ErrNoAvailableClients is thrown when there are no clients to accept the transfer. // This is generally thrown when there are either no clients connected or they're all in use. ErrNoAvailableClients = Error("no available clients, either they're all in use or none are connected") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AvailableDo ¶
type Error ¶
type Error string
Error is a custom error implementation for the `manager` package in-order to have them stored as constants.
func ErrClientAlreadyConnected ¶
ErrClientAlreadyConnected is thrown when the client connection is present in the manager.
func ErrClientNotConnected ¶
ErrClientNotConnected is thrown when the client connection is not present in the manager.
func ErrTransferIsAlreadyActiveAndOwnedBy ¶
ErrTransferIsAlreadyActiveAndOwnedBy is thrown when we try to assign a transfer that's already owned by another client.
type Manager ¶
type Manager interface { Info() []client.Info Client(claims *claims.RunnerClaims) (client client.Client) Connect(claims *claims.RunnerClaims) (connected client.Client, err error) Disconnect(claims *claims.RunnerClaims) (err error) ToggleState(claims *claims.RunnerClaims) (state client.State, err error) Pause(claims *claims.RunnerClaims) Has(claims *claims.RunnerClaims) (ok bool) Len() int // Owns returns the client that owns the transfer for the requested, // owner can be nil if no owner is found. Owns(anime domain.AnimeBase) (owner client.Client) // AvailableDo will return a client that doesn't have a transfer assigned, // for the duration of the available func the manager will have the read lock. AvailableDo(anime domain.AnimeBase, fn AvailableDo) (assignee client.Client, err error) }
func NewManager ¶
func NewManager() Manager
Click to show internal directories.
Click to hide internal directories.