Expire K/V Values

Regenerate Code

pathfix

Update Expiry on Update

Check for Exit Signal

gofmt

Rewrote Go Routine

Remove tempoarily cleanup loop

fix expiretime

TEST: Expired Watchdog as GoRoutine

Check if Srv is nil

Use Scheduler/Worker for Expired Key CleanUp

add license

fix scheduler job type; DoJob Restructuring

Remove unused imports and constants

move db migration from 5.4 to 5.5
Этот коммит содержится в:
Daniel Schalla
2018-10-10 19:55:12 +02:00
коммит произвёл Christopher Speller
родитель bd04d7f756
Коммит c36e85c912
20 изменённых файлов: 501 добавлений и 4 удалений

Просмотреть файл

@@ -2156,6 +2156,36 @@ func (s *apiRPCServer) KVSet(args *Z_KVSetArgs, returns *Z_KVSetReturns) error {
return nil
}
type Z_KVSetWithExpiryArgs struct {
A string
B []byte
C int64
}
type Z_KVSetWithExpiryReturns struct {
A *model.AppError
}
func (g *apiRPCClient) KVSetWithExpiry(key string, value []byte, expireInSeconds int64) *model.AppError {
_args := &Z_KVSetWithExpiryArgs{key, value, expireInSeconds}
_returns := &Z_KVSetWithExpiryReturns{}
if err := g.client.Call("Plugin.KVSetWithExpiry", _args, _returns); err != nil {
log.Printf("RPC call to KVSetWithExpiry API failed: %s", err.Error())
}
return _returns.A
}
func (s *apiRPCServer) KVSetWithExpiry(args *Z_KVSetWithExpiryArgs, returns *Z_KVSetWithExpiryReturns) error {
if hook, ok := s.impl.(interface {
KVSetWithExpiry(key string, value []byte, expireInSeconds int64) *model.AppError
}); ok {
returns.A = hook.KVSetWithExpiry(args.A, args.B, args.C)
} else {
return encodableError(fmt.Errorf("API KVSetWithExpiry called but not implemented."))
}
return nil
}
type Z_KVGetArgs struct {
A string
}
@@ -2213,6 +2243,33 @@ func (s *apiRPCServer) KVDelete(args *Z_KVDeleteArgs, returns *Z_KVDeleteReturns
return nil
}
type Z_KVDeleteAllArgs struct {
}
type Z_KVDeleteAllReturns struct {
A *model.AppError
}
func (g *apiRPCClient) KVDeleteAll() *model.AppError {
_args := &Z_KVDeleteAllArgs{}
_returns := &Z_KVDeleteAllReturns{}
if err := g.client.Call("Plugin.KVDeleteAll", _args, _returns); err != nil {
log.Printf("RPC call to KVDeleteAll API failed: %s", err.Error())
}
return _returns.A
}
func (s *apiRPCServer) KVDeleteAll(args *Z_KVDeleteAllArgs, returns *Z_KVDeleteAllReturns) error {
if hook, ok := s.impl.(interface {
KVDeleteAll() *model.AppError
}); ok {
returns.A = hook.KVDeleteAll()
} else {
return encodableError(fmt.Errorf("API KVDeleteAll called but not implemented."))
}
return nil
}
type Z_KVListArgs struct {
A int
B int