11# Kernel Go API Library
22
3- <a href =" https://pkg.go.dev/github.com/stainless-sdks /kernel-go " ><img src =" https://pkg.go.dev/badge/github.com/stainless-sdks /kernel-go.svg " alt =" Go Reference " ></a >
3+ <a href =" https://pkg.go.dev/github.com/onkernel /kernel-go-sdk " ><img src =" https://pkg.go.dev/badge/github.com/onkernel /kernel-go-sdk .svg " alt =" Go Reference " ></a >
44
55The Kernel Go library provides convenient access to the [ Kernel REST API] ( https://docs.onkernel.com )
66from applications written in Go.
@@ -9,18 +9,26 @@ It is generated with [Stainless](https://www.stainless.com/).
99
1010## Installation
1111
12+ <!-- x-release-please-start-version -->
13+
1214``` go
1315import (
14- " github.com/stainless-sdks /kernel-go" // imported as kernel
16+ " github.com/onkernel /kernel-go-sdk " // imported as kernel
1517)
1618```
1719
20+ <!-- x-release-please-end -->
21+
1822Or to pin the version:
1923
24+ <!-- x-release-please-start-version -->
25+
2026``` sh
21- go get -u ' github.com/stainless-sdks /kernel-go@v0.0.1 -alpha.0 '
27+ go get -u ' github.com/onkernel /kernel-go-sdk @v0.1.0 -alpha.1 '
2228```
2329
30+ <!-- x-release-please-end -->
31+
2432## Requirements
2533
2634This library requires Go 1.18+.
@@ -38,8 +46,8 @@ import (
3846 " fmt"
3947 " io"
4048
41- " github.com/stainless-sdks /kernel-go"
42- " github.com/stainless-sdks /kernel-go/option"
49+ " github.com/onkernel /kernel-go-sdk "
50+ " github.com/onkernel /kernel-go-sdk /option"
4351)
4452
4553func main () {
@@ -48,8 +56,9 @@ func main() {
4856 option.WithEnvironmentDevelopment (), // defaults to option.WithEnvironmentProduction()
4957 )
5058 response , err := client.Apps .Deploy (context.TODO (), kernel.AppDeployParams {
51- File: io.Reader (bytes.NewBuffer ([]byte (" REPLACE_ME" ))),
52- Version: kernel.String (" REPLACE_ME" ),
59+ EntrypointRelPath: " app.py" ,
60+ File: io.Reader (bytes.NewBuffer ([]byte (" REPLACE_ME" ))),
61+ Version: kernel.String (" REPLACE_ME" ),
5362 })
5463 if err != nil {
5564 panic (err.Error ())
@@ -268,7 +277,7 @@ client.Apps.Deploy(context.TODO(), ...,
268277)
269278```
270279
271- See the [ full list of request options] ( https://pkg.go.dev/github.com/stainless-sdks /kernel-go/option ) .
280+ See the [ full list of request options] ( https://pkg.go.dev/github.com/onkernel /kernel-go-sdk /option ) .
272281
273282### Pagination
274283
@@ -290,8 +299,9 @@ To handle errors, we recommend that you use the `errors.As` pattern:
290299
291300``` go
292301_ , err := client.Apps .Deploy (context.TODO (), kernel.AppDeployParams {
293- File : io.Reader (bytes.NewBuffer ([]byte (" REPLACE_ME" ))),
294- Version : kernel.String (" REPLACE_ME" ),
302+ EntrypointRelPath : " app.py" ,
303+ File : io.Reader (bytes.NewBuffer ([]byte (" REPLACE_ME" ))),
304+ Version : kernel.String (" REPLACE_ME" ),
295305})
296306if err != nil {
297307 var apierr *kernel.Error
@@ -320,8 +330,9 @@ defer cancel()
320330client.Apps .Deploy (
321331 ctx,
322332 kernel.AppDeployParams {
323- File : io.Reader (bytes.NewBuffer ([]byte (" REPLACE_ME" ))),
324- Version : kernel.String (" REPLACE_ME" ),
333+ EntrypointRelPath : " app.py" ,
334+ File : io.Reader (bytes.NewBuffer ([]byte (" REPLACE_ME" ))),
335+ Version : kernel.String (" REPLACE_ME" ),
325336 },
326337 // This sets the per-retry timeout
327338 option.WithRequestTimeout (20 *time.Second ),
@@ -345,17 +356,20 @@ which can be used to wrap any `io.Reader` with the appropriate file name and con
345356// A file from the file system
346357file , err := os.Open (" /path/to/file" )
347358kernel.AppDeployParams {
348- File : file,
359+ EntrypointRelPath : " app.py" ,
360+ File : file,
349361}
350362
351363// A file from a string
352364kernel.AppDeployParams {
353- File : strings.NewReader (" my file contents" ),
365+ EntrypointRelPath : " app.py" ,
366+ File : strings.NewReader (" my file contents" ),
354367}
355368
356369// With a custom filename and contentType
357370kernel.AppDeployParams {
358- File : kernel.File (strings.NewReader (` {"hello": "foo"}` ), " file.go" , " application/json" ),
371+ EntrypointRelPath : " app.py" ,
372+ File : kernel.File (strings.NewReader (` {"hello": "foo"}` ), " file.go" , " application/json" ),
359373}
360374```
361375
@@ -377,8 +391,9 @@ client := kernel.NewClient(
377391client.Apps .Deploy (
378392 context.TODO (),
379393 kernel.AppDeployParams {
380- File : io.Reader (bytes.NewBuffer ([]byte (" REPLACE_ME" ))),
381- Version : kernel.String (" REPLACE_ME" ),
394+ EntrypointRelPath : " app.py" ,
395+ File : io.Reader (bytes.NewBuffer ([]byte (" REPLACE_ME" ))),
396+ Version : kernel.String (" REPLACE_ME" ),
382397 },
383398 option.WithMaxRetries (5 ),
384399)
@@ -395,8 +410,9 @@ var response *http.Response
395410response , err := client.Apps .Deploy (
396411 context.TODO (),
397412 kernel.AppDeployParams {
398- File : io.Reader (bytes.NewBuffer ([]byte (" REPLACE_ME" ))),
399- Version : kernel.String (" REPLACE_ME" ),
413+ EntrypointRelPath : " app.py" ,
414+ File : io.Reader (bytes.NewBuffer ([]byte (" REPLACE_ME" ))),
415+ Version : kernel.String (" REPLACE_ME" ),
400416 },
401417 option.WithResponseInto (&response),
402418)
@@ -504,7 +520,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
504520
505521We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
506522
507- We are keen for your feedback; please open an [ issue] ( https://www.github.com/stainless-sdks /kernel-go/issues ) with questions, bugs, or suggestions.
523+ We are keen for your feedback; please open an [ issue] ( https://www.github.com/onkernel /kernel-go-sdk /issues ) with questions, bugs, or suggestions.
508524
509525## Contributing
510526
0 commit comments