mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-02 00:10:45 +02:00
config: allow dynamic configuration of cookie settings (#1267)
This commit is contained in:
parent
0c51ad0e66
commit
fbf5b403b9
17 changed files with 184 additions and 165 deletions
|
@ -12,6 +12,7 @@ import (
|
|||
"reflect"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"github.com/cespare/xxhash/v2"
|
||||
|
@ -986,3 +987,25 @@ func min(x, y int) int {
|
|||
}
|
||||
return y
|
||||
}
|
||||
|
||||
// AtomicOptions are Options that can be access atomically.
|
||||
type AtomicOptions struct {
|
||||
value atomic.Value
|
||||
}
|
||||
|
||||
// NewAtomicOptions creates a new AtomicOptions.
|
||||
func NewAtomicOptions() *AtomicOptions {
|
||||
ao := new(AtomicOptions)
|
||||
ao.Store(new(Options))
|
||||
return ao
|
||||
}
|
||||
|
||||
// Load loads the options.
|
||||
func (a *AtomicOptions) Load() *Options {
|
||||
return a.value.Load().(*Options)
|
||||
}
|
||||
|
||||
// Store stores the options.
|
||||
func (a *AtomicOptions) Store(options *Options) {
|
||||
a.value.Store(options)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue