Documentation ¶
Index ¶
- Constants
- Variables
- type AccessController
- type Cache
- func (c *Cache) Delete(key string)
- func (c *Cache) Exists(key string) bool
- func (c *Cache) Get(key string) (string, bool)
- func (c *Cache) GetAndFetchIfExpired(ctx context.Context, key string) (string, error)
- func (c *Cache) Set(key, value string, ttl time.Duration)
- func (c *Cache) ZScanAndFetchIfExpired(ctx context.Context, key, target string) ([]string, error)
- type Client
- type Config
- type Error
- type QueueConfirmation
- type QueueResult
- type Site
Constants ¶
View Source
const EnableDomainKey = "queue-domains"
制限中のドメインリスト
View Source
const SuffixCacheEnable = "_enable_cache"
View Source
const SuffixCurrentNo = "_current_no"
View Source
const SuffixLastNo = "_last_no"
View Source
const SuffixPermittedNo = "_permitted_no"
View Source
const SuffixPermittedNoLock = "_permitted_no_lock"
View Source
const WhiteListKey = "queue-whitelist"
Variables ¶
View Source
var ErrClientNotIncrese = errors.New("client not increase")
Functions ¶
This section is empty.
Types ¶
type AccessController ¶
type AccessController struct {
// contains filtered or unexported fields
}
func NewAccessController ¶
func NewAccessController(config *Config, redisClient *redis.Client, cache *Cache) *AccessController
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) GetAndFetchIfExpired ¶
type Client ¶
type Client struct { SerialNumber int64 // 通し番号 ID string // ユーザー固有ID TakeSerialNumberTime int64 // シリアルナンバーを取得するUNIXTIME // contains filtered or unexported fields }
func NewClientByContext ¶
func NewClientByContext(ctx echo.Context, sc *securecookie.SecureCookie) (*Client, error)
type Config ¶
type Config struct { LogLevel string Listener string PermittedAccessSec int `mapstructure:"permitted_access_sec,omitempty" validate:"required"` // アクセス許可後アクセスできる時間 EntryDelaySec int64 `mapstructure:"entry_delay_sec,omitempty" validate:"required"` // 初回エントリーをDelayさせる秒数 QueueEnableSec int `mapstructure:"queue_enable_sec,omitempty" validate:"required"` // 待合室を有効にしておく時間 PermitIntervalSec int `mapstructure:"permit_interval_sec,omitempty" validate:"required,gtefield=CacheTTLSec,gtefield=NegativeCacheTTLSec"` // アクセス許可判定周期 PermitUnitNumber int64 `mapstructure:"permit_unit_number,omitempty" validate:"required"` // アクセス許可する単位(PermitIntervalSecあたりPermitUnitNumber許可) CacheTTLSec int `mapstructure:"cache_ttl_sec,omitempty" validate:"required"` // ローカルメモリキャッシュTTL NegativeCacheTTLSec int `mapstructure:"negative_cache_ttl_sec,omitempty" validate:"required"` // ローカルメモリネガティブキャッシュTTL PublicHost string `mapstructure:"public_host,omitempty"` // 公開URLのホスト SlackApiToken string `mapstructure:"slack_api_token,omitempty"` // Slack Api Token SlackChannel string `mapstructure:"slack_channel,omitempty"` // Slack Channel EnableOtel bool `mapstructure:"enable_otel,omitempty"` // OpenTelemetryによるトレースを有効にする }
type QueueConfirmation ¶
type QueueConfirmation struct {
// contains filtered or unexported fields
}
func NewQueueConfirmation ¶
func NewQueueConfirmation( sc *securecookie.SecureCookie, config *Config, redisClient *redis.Client, cache *Cache, ) *QueueConfirmation
func (*QueueConfirmation) Do ¶
func (p *QueueConfirmation) Do(c echo.Context) error
type QueueResult ¶
Click to show internal directories.
Click to hide internal directories.