Documentation ¶
Index ¶
- type LocalStateService
- func (s *LocalStateService) FetchDistLock(lockKey string, locker string, expiredInMS int) (bool, error)
- func (s *LocalStateService) GetDistState(stateKey string) (state string, err error)
- func (s *LocalStateService) GetLockerID() string
- func (s *LocalStateService) ReleaseDistLock(lockKey string, locker string) (bool, error)
- func (s *LocalStateService) RemoveStateFile(stateKey string) error
- func (s *LocalStateService) SetDistState(stateKey string, stateValue string) error
- func (s *LocalStateService) UnlockDistLockWithState(lockKey string, locker string, stateKey string, stateValue string) (bool, error)
- type RedisDistributeStateService
- func (s *RedisDistributeStateService) FetchDistLock(lockKey string, locker string, expiredInMS int) (bool, error)
- func (s *RedisDistributeStateService) GetDistState(stateKey string) (string, error)
- func (s *RedisDistributeStateService) GetLockerID() string
- func (s *RedisDistributeStateService) ReleaseDistLock(lockKey string, locker string) (bool, error)
- func (s *RedisDistributeStateService) SetDistState(stateKey string, stateValue string) error
- func (s *RedisDistributeStateService) UnlockDistLockWithState(lockKey string, locker string, stateKey string, stateValue string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocalStateService ¶
type LocalStateService struct {
// contains filtered or unexported fields
}
LocalStateService is designed to save stream state info into a local file. It's not supported to satisfy HA requirement. It mainly works when paired with LocalWebSocketEngine.
func NewLocalStateService ¶
func (*LocalStateService) FetchDistLock ¶
func (s *LocalStateService) FetchDistLock(lockKey string, locker string, expiredInMS int) (bool, error)
DiskLock is not supported in LocalStateService, in the other word, FetchDistLock and ReleaseDistLock will always be success.
func (*LocalStateService) GetDistState ¶
func (s *LocalStateService) GetDistState(stateKey string) (state string, err error)
func (*LocalStateService) GetLockerID ¶
func (s *LocalStateService) GetLockerID() string
func (*LocalStateService) ReleaseDistLock ¶
func (s *LocalStateService) ReleaseDistLock(lockKey string, locker string) (bool, error)
func (*LocalStateService) RemoveStateFile ¶
func (s *LocalStateService) RemoveStateFile(stateKey string) error
func (*LocalStateService) SetDistState ¶
func (s *LocalStateService) SetDistState(stateKey string, stateValue string) error
func (*LocalStateService) UnlockDistLockWithState ¶
type RedisDistributeStateService ¶
type RedisDistributeStateService struct {
// contains filtered or unexported fields
}
func (*RedisDistributeStateService) FetchDistLock ¶
func (*RedisDistributeStateService) GetDistState ¶
func (s *RedisDistributeStateService) GetDistState(stateKey string) (string, error)
func (*RedisDistributeStateService) GetLockerID ¶
func (s *RedisDistributeStateService) GetLockerID() string
func (*RedisDistributeStateService) ReleaseDistLock ¶
func (s *RedisDistributeStateService) ReleaseDistLock(lockKey string, locker string) (bool, error)
func (*RedisDistributeStateService) SetDistState ¶
func (s *RedisDistributeStateService) SetDistState(stateKey string, stateValue string) error
func (*RedisDistributeStateService) UnlockDistLockWithState ¶
Click to show internal directories.
Click to hide internal directories.