Go Kratos Client on Github

Hi,

Is the go Kratos client is usable ?
on https://github.com/ory/kratos-client-go there’s no readme.md explaining how to use it. What is the package to import ? github.com/ory/kratos-client-go/client ? or github.com/ory/kratos-client-go/go/client ?
Is there a little code sample I can get inspiration from ?

Thanks for your help,
Mikaël

Did you see this issue?

no I didn’t see it
but it’s the same problem.
Do you plan to update the git ?

Of course

1 Like

Still no updates from February. I have same problem as mikaelmorvan

When Go SDK documentation will be updated (or created at least)?

Hey, could you open an issue regarding this?
Maybe it slipped through the cracks…

The issue has been resolved, what problem are you actually facing? Please be more specific.

Hi all,

in case anybody needs a quick reference to get started with the kratos go client, this works for me:

package main

import (
	"fmt"
	"net/url"

	kratos "github.com/ory/kratos-client-go/client"
	"github.com/ory/kratos-client-go/client/health"
	"github.com/ory/kratos-client-go/client/version"
)

func main() {
	adminURL, err := url.Parse("http://localhost:4434")

	if err != nil {
		fmt.Println(err)
		return
	}

	admin := kratos.NewHTTPClientWithConfig(
		nil,
		&kratos.TransportConfig{
			Schemes:  []string{adminURL.Scheme},
			Host:     adminURL.Host,
			BasePath: adminURL.Path})

	vers, err := admin.Version.GetVersion(version.NewGetVersionParams())
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(vers.GetPayload().Version)

	ok, err := admin.Health.IsInstanceAlive(health.NewIsInstanceAliveParams())
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(ok.Payload.Status)
}

2 Likes

Do you have any recommendations on how to mock kratos-client-go for use in unit tests?

How about https://github.com/ory/dockertest?