Skip to content

Commit

Permalink
Merge pull request #396 from AzureAD/dev
Browse files Browse the repository at this point in the history
MSAL Go 0.9.0
  • Loading branch information
rayluo committed Mar 7, 2023
2 parents 24a6783 + 9a63cc2 commit 3f4287d
Show file tree
Hide file tree
Showing 26 changed files with 631 additions and 471 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
go: ["1.19", "1.18"]
go: ["1.19", "1.20"]

steps:
- name: Set up Go 1.x
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: "1.20"
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.49
version: v1.51

# Optional: golangci-lint command line arguments.
# args: --issues-exit-code=0
31 changes: 23 additions & 8 deletions apps/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ implementers on the format being passed.
*/
package cache

import "context"

// Marshaler marshals data from an internal cache to bytes that can be stored.
type Marshaler interface {
Marshal() ([]byte, error)
Expand All @@ -27,13 +29,26 @@ type Serializer interface {
Unmarshaler
}

// ExportReplace is used export or replace what is in the cache.
// ExportHints are suggestions for storing data.
type ExportHints struct {
// PartitionKey is a suggested key for partitioning the cache
PartitionKey string
}

// ReplaceHints are suggestions for loading data.
type ReplaceHints struct {
// PartitionKey is a suggested key for partitioning the cache
PartitionKey string
}

// ExportReplace exports and replaces in-memory cache data. It doesn't support nil Context or
// define the outcome of passing one. A Context without a timeout must receive a default timeout
// specified by the implementor. Retries must be implemented inside the implementation.
type ExportReplace interface {
// Replace replaces the cache with what is in external storage.
// key is the suggested key which can be used for partioning the cache
Replace(cache Unmarshaler, key string)
// Export writes the binary representation of the cache (cache.Marshal()) to
// external storage. This is considered opaque.
// key is the suggested key which can be used for partioning the cache
Export(cache Marshaler, key string)
// Replace replaces the cache with what is in external storage. Implementors should honor
// Context cancellations and return context.Canceled or context.DeadlineExceeded in those cases.
Replace(ctx context.Context, cache Unmarshaler, hints ReplaceHints) error
// Export writes the binary representation of the cache (cache.Marshal()) to external storage.
// This is considered opaque. Context cancellations should be honored as in Replace.
Export(ctx context.Context, cache Marshaler, hints ExportHints) error
}
Loading

0 comments on commit 3f4287d

Please sign in to comment.