client

package
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2025 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const TEMPLATE_MAIN = `
package apogy

import (
	openapi "github.com/aep/apogy/api/go"
)


type Document[Val any] struct {
	openapi.Document
	Val Val ` + "`json:\"val\"`" + `
}

{{range $t, $n := .Types}} 
type {{$t}} Document[{{$t}}Val]
{{end}} 

type Client struct {
	openapi.ClientInterface
	{{range $t, $n := .Types}}
	{{$t}} *openapi.TypedClient[{{$t}}]
	{{end}}
}

type ClientOption openapi.ClientOption

func NewClient(server string, opts ...ClientOption) (*Client, error) {

	var optss []openapi.ClientOption
	for _, o := range opts {
		optss = append(optss, openapi.ClientOption(o))
	}

	client, err := openapi.NewClient(server, optss...)
	if err != nil {
		return nil, err
	}

	r := &Client{ClientInterface: client}

	{{range $t,$n := .Types}}
	r.{{$t}}  = &openapi.TypedClient[{{$t}}]{client, "{{$n}}"}
	{{end}}

	return r, nil
}

`
View Source
const TEMPLATE_MODEL = `
package apogy

import (
)

`

Variables

This section is empty.

Functions

func RegisterCommands

func RegisterCommands(root *cobra.Command)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL