Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Description
# Skyflow Go SDK
This go SDK is designed to help developers easily implement Skyflow into their go backend.

[![CI](https://img.shields.io/static/v1?label=CI&message=passing&color=green?style=plastic&logo=github)](https://github.com/skyflowapi/skyflow-go/actions)
Expand All @@ -8,7 +8,6 @@ This go SDK is designed to help developers easily implement Skyflow into their g

# Table of Contents

- [Description](#description)
- [Table of Contents](#table-of-contents)
- [Features](#features)
- [Installation](#installation)
Expand Down Expand Up @@ -87,8 +86,39 @@ func GetSkyflowBearerToken() (string, error) {
return bearerToken, nil
}
```
[Example using cred json string](https://github.com/skyflowapi/skyflow-go/blob/main/samples/serviceaccount/token/main/service_account_token_using_cred_string.go):
```go
package main

import (
"fmt"

logger "github.com/skyflowapi/skyflow-go/commonutils/logwrapper"
saUtil "github.com/skyflowapi/skyflow-go/serviceaccount/util"
)

var token = ""

func main() {

defer func() {
if err := recover(); err != nil {
fmt.Println("error : ", err)
}
}()
logger.SetLogLevel(logger.INFO) //set loglevel to INFO
credentials:= "<credentials_in_string_format>"
if saUtil.IsExpired(token) {
newToken, err := saUtil.GenerateBearerTokenFromCreds(credentials)
if err != nil {
panic(err)
} else {
token = newToken.AccessToken
}
fmt.Println("%v", token)
}
}
```
### Vault APIs

The [Vault](https://github.com/skyflowapi/skyflow-go/skyflow/vault-api) Go module is used to perform operations on the vault such as inserting records, detokenizing tokens, retrieving tokens for a skyflow_id and to invoke a connection.
Expand Down