diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..c3a4938 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,14 @@ +name: Go +on: [push, pull_request] +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: ^1.15 + - name: Checkout code + uses: actions/checkout@v3 + - name: Run tests + run: go test -race -timeout 1m ./... diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 06007d3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: go - -go: - - "1.17.x" - - "1.16.x" - -git: - depth: 1 - -install: - - go install -race std - - go install golang.org/x/tools/cmd/cover - - go install golang.org/x/lint/golint - - export PATH=$HOME/gopath/bin:$PATH - - go get golang.org/x/tools/cmd/cover - - go get github.com/mattn/goveralls - -script: - - golint . - - go test -cover -race -count=1 -timeout=30s -run . - - go test -covermode=count -coverprofile=coverage.out -timeout=90s -run . - - if test ! -z "$COVERALLS_TOKEN"; then $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN; fi - - cd bench; go test -run=Bench.* -bench=. -benchmem; cd .. \ No newline at end of file diff --git a/LICENSE b/LICENSE index b3b587d..f36a3b9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Rene Kroon +Copyright (c) 2022 Jellydator Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Readme.md b/Readme.md index 6bc07b8..9c736cd 100644 --- a/Readme.md +++ b/Readme.md @@ -1,7 +1,7 @@ # TTLCache - an in-memory cache with expiration -[![Documentation](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/ReneKroon/ttlcache/v2) -[![Release](https://img.shields.io/github/release/ReneKroon/ttlcache.svg?label=Release)](https://github.com/ReneKroon/ttlcache/releases) +**Although v2 of ttlcache is not yet deprecated, v3 should be used as it +contains quite a few additions and improvements.** TTLCache is a simple key/value cache in golang with the following functions: @@ -15,15 +15,9 @@ TTLCache is a simple key/value cache in golang with the following functions: Note (issue #25): by default, due to historic reasons, the TTL will be reset on each cache hit and you need to explicitly configure the cache to use a TTL that will not get extended. -[![Build Status](https://www.travis-ci.com/ReneKroon/ttlcache.svg?branch=master)](https://travis-ci.com/ReneKroon/ttlcache) -[![Go Report Card](https://goreportcard.com/badge/github.com/ReneKroon/ttlcache)](https://goreportcard.com/report/github.com/ReneKroon/ttlcache) -[![Coverage Status](https://coveralls.io/repos/github/ReneKroon/ttlcache/badge.svg?branch=master)](https://coveralls.io/github/ReneKroon/ttlcache?branch=master) -[![GitHub issues](https://img.shields.io/github/issues/ReneKroon/ttlcache.svg)](https://github.com/ReneKroon/ttlcache/issues) -[![license](https://img.shields.io/github/license/ReneKroon/ttlcache.svg?maxAge=2592000)](https://github.com/ReneKroon/ttlcache/LICENSE) - ## Usage -`go get github.com/ReneKroon/ttlcache/v2` +`go get github.com/jellydator/ttlcache/v2` You can copy it as a full standalone demo program. The first snippet is basic usage, where the second exploits more options in the cache. @@ -35,7 +29,7 @@ import ( "fmt" "time" - "github.com/ReneKroon/ttlcache/v2" + "github.com/jellydator/ttlcache/v2" ) var notFound = ttlcache.ErrNotFound @@ -65,7 +59,7 @@ import ( "fmt" "time" - "github.com/ReneKroon/ttlcache/v2" + "github.com/jellydator/ttlcache/v2" ) var ( diff --git a/bench/bench_test.go b/bench/bench_test.go index b4e9d5e..8e4d435 100644 --- a/bench/bench_test.go +++ b/bench/bench_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - ttlcache "github.com/ReneKroon/ttlcache/v2" + ttlcache "github.com/jellydator/ttlcache/v2" ) func BenchmarkCacheSetWithoutTTL(b *testing.B) { diff --git a/cache_test.go b/cache_test.go index 4d41af7..a0239ac 100644 --- a/cache_test.go +++ b/cache_test.go @@ -12,7 +12,7 @@ import ( "fmt" "sync" - . "github.com/ReneKroon/ttlcache/v2" + . "github.com/jellydator/ttlcache/v2" "github.com/stretchr/testify/assert" ) diff --git a/go.mod b/go.mod index c39d9fd..f8086ee 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/ReneKroon/ttlcache/v2 +module github.com/jellydator/ttlcache/v2 go 1.15