-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from kelchy/main
Release rmq/publisher 0.1.0
- Loading branch information
Showing
65 changed files
with
3,756 additions
and
932 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//v0.0.6 | ||
//v0.1.0 | ||
module github.com/kelchy/go-lib/http/client | ||
|
||
require ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//v0.1.0 | ||
//v0.1.1 | ||
module github.com/kelchy/go-lib/http/server | ||
|
||
require ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//v0.0.10 | ||
//v0.0.11 | ||
module github.com/kelchy/go-lib/log | ||
|
||
go 1.18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,48 @@ | ||
package main | ||
|
||
import ( | ||
"time" | ||
"context" | ||
"fmt" | ||
"os" | ||
"time" | ||
|
||
"github.com/kelchy/go-lib/redis" | ||
) | ||
|
||
func main() { | ||
uri := os.Getenv("REDIS_URI") | ||
redisclient, e := redis.New(uri) | ||
if e != nil { | ||
|
||
uri := "<redis uri here>" | ||
|
||
// path to cert files | ||
clientCertPath := "<file-path>" | ||
clientKeyPath := `<file-path>` | ||
|
||
// use redis.New if TLS connection is not required | ||
// skipVerifyCondition should only be true when running locally | ||
redisclient, e := redis.NewSecure(uri, clientCertPath, clientKeyPath, false) | ||
if e != nil { | ||
fmt.Println(e) | ||
return | ||
} | ||
|
||
keys, _ := redisclient.Keys(nil, "*") | ||
// inputting nil will cause an error, context.TODO() is preferred | ||
keys, _ := redisclient.Keys(context.TODO(), "*") | ||
fmt.Println("keys", keys) | ||
|
||
res, _ := redisclient.Set(nil, "key", "value2", 10 * time.Second) | ||
res, _ := redisclient.Set(context.TODO(), "key", "value2", 10*time.Second) | ||
fmt.Println("result", res) | ||
|
||
resi, _ := redisclient.Del(nil, "key") | ||
resi, _ := redisclient.Del(context.TODO(), "key") | ||
fmt.Println("result int", resi) | ||
|
||
resb, _ := redisclient.SetNX(nil, "key", "value2", 10 * time.Second) | ||
resb, _ := redisclient.SetNX(context.TODO(), "key", "value2", 10*time.Second) | ||
fmt.Println("result bool", resb) | ||
|
||
val, _ := redisclient.Get(nil, "key") | ||
val, _ := redisclient.Get(context.TODO(), "key") | ||
fmt.Println("result value", val) | ||
|
||
lock, _ := redisclient.Lock(nil, "locktest", 20 * time.Second) | ||
lock, _ := redisclient.Lock(context.TODO(), "locktest", 20*time.Second) | ||
fmt.Println("result lock", lock) | ||
|
||
unlock, _ := redisclient.Unlock(nil, "locktest") | ||
unlock, _ := redisclient.Unlock(context.TODO(), "locktest") | ||
fmt.Println("result unlock", unlock) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//v0.0.4 | ||
//v0.0.9 | ||
module github.com/kelchy/go-lib/redis | ||
|
||
require ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.