mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-19 03:57:17 +02:00
atomicutil: use atomicutil.Value wherever possible (#3517)
* atomicutil: use atomicutil.Value wherever possible * fix test * fix mux router
This commit is contained in:
parent
5c14d2c994
commit
0ac7e45a21
23 changed files with 121 additions and 215 deletions
|
@ -6,7 +6,6 @@ import (
|
|||
"encoding/base64"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/go-jose/go-jose/v3"
|
||||
|
||||
|
@ -172,21 +171,3 @@ func newAuthenticateStateFromConfig(cfg *config.Config) (*authenticateState, err
|
|||
|
||||
return state, nil
|
||||
}
|
||||
|
||||
type atomicAuthenticateState struct {
|
||||
atomic.Value
|
||||
}
|
||||
|
||||
func newAtomicAuthenticateState(state *authenticateState) *atomicAuthenticateState {
|
||||
aas := new(atomicAuthenticateState)
|
||||
aas.Store(state)
|
||||
return aas
|
||||
}
|
||||
|
||||
func (aas *atomicAuthenticateState) Load() *authenticateState {
|
||||
return aas.Value.Load().(*authenticateState)
|
||||
}
|
||||
|
||||
func (aas *atomicAuthenticateState) Store(state *authenticateState) {
|
||||
aas.Value.Store(state)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue