From 90502c3029c55bf716d61b606016880fb16ab423 Mon Sep 17 00:00:00 2001 From: mountain Date: Thu, 31 Aug 2023 21:12:08 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EB=A6=84=20=EB=8B=A4=EC=8B=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- session/common.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) }