diff --git a/session/common.go b/session/common.go index 7be9c41..3694020 100644 --- a/session/common.go +++ b/session/common.go @@ -82,7 +82,7 @@ func publickey_to_storagekey(pk publickey) storagekey { return storagekey(hex.EncodeToString(decoded[:])) } -type Config struct { +type SessionConfig struct { SessionTTL int64 `json:"session_ttl"` SessionStorage string `json:"session_storage"` } @@ -101,7 +101,7 @@ func NewConsumer(ctx context.Context, storageAddr string, ttl time.Duration) (Co return nil, errInvalidScheme } -func NewConsumerWithConfig(ctx context.Context, cfg Config) (Consumer, error) { +func NewConsumerWithConfig(ctx context.Context, cfg SessionConfig) (Consumer, error) { return NewConsumer(ctx, cfg.SessionStorage, time.Duration(cfg.SessionTTL)*time.Second) } @@ -117,6 +117,6 @@ func NewProvider(ctx context.Context, storageAddr string, ttl time.Duration) (Pr return nil, errInvalidScheme } -func NewProviderWithConfig(ctx context.Context, cfg Config) (Provider, error) { +func NewProviderWithConfig(ctx context.Context, cfg SessionConfig) (Provider, error) { return NewProvider(ctx, cfg.SessionStorage, time.Duration(cfg.SessionTTL)*time.Second) }