mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-10 15:47:36 +02:00
replace GetAllPages with InitialSync, improve merge performance (#1624)
* replace GetAllPages with InitialSync, improve merge performance * fmt proto * add test for base64 function * add sync test * go mod tidy Co-authored-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
parent
ba55fec67c
commit
aad8ac2e61
10 changed files with 298 additions and 214 deletions
20
internal/encoding/base64_test.go
Normal file
20
internal/encoding/base64_test.go
Normal file
|
@ -0,0 +1,20 @@
|
|||
package encoding
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestDecodeBase64OrJSON(t *testing.T) {
|
||||
var obj struct {
|
||||
X string `json:"x"`
|
||||
}
|
||||
err := DecodeBase64OrJSON(` {"x": "y"} `, &obj)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "y", obj.X)
|
||||
|
||||
err = DecodeBase64OrJSON(` eyJ4IjoieiJ9Cg== `, &obj)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "z", obj.X)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue