sdk/cmd/main.go

30 lines
537 B
Go
Raw Normal View History

2024-07-21 10:15:55 +00:00
package main
2024-07-22 19:13:54 +00:00
import (
2024-10-20 12:55:16 +00:00
"context"
"os"
2024-07-22 19:13:54 +00:00
"git.geekeey.de/actions/sdk"
2024-10-20 12:55:16 +00:00
"git.geekeey.de/actions/sdk/cache"
2024-07-22 19:13:54 +00:00
)
2024-07-21 10:15:55 +00:00
func main() {
a := sdk.New()
a.AddMask("hello")
a.WithFieldsSlice("foo=bar", "biz=baz").Debugf("hello world")
2024-10-20 12:55:16 +00:00
blob, err := a.Cache().Load(context.Background(), "example")
if err != nil {
panic(err)
}
cache.Tar("./foo")
f, err := os.Open("")
if err != nil {
panic(err)
}
a.Cache().Save(context.Background(), "", cache.NewFileBlob(f))
entry := blob.Download(context.Background())
if entry == nil {
return
}
2024-07-21 10:15:55 +00:00
}