Help us shape the future of Go! Take the 2026 Go Developer Survey

internal

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InferKind

func InferKind[M any]() string

InferKind follows the naming of the meshObject API: MeshWorkspace gives meshWorkspace, and MeshBuildingBlockV2 gives meshBuildingBlock.

Types

type HttpClient

type HttpClient struct {
	http.AuthorizedClient

	EndpointUrl xurl.URL
}

type ListOptions added in v0.2.0

type ListOptions struct {
	PageSize int
	OnPage   func(Page)
}

type MeshObjectApi added in v0.3.0

type MeshObjectApi struct {
	http.AuthorizedClient

	Kind       string
	ApiVersion string
	ApiUrl     *url.URL
}

MeshObjectApi is the API of one meshObject kind, in one version, with no Go type for its objects: the requests and the paging they share, for a caller that decodes the answers itself.

func (MeshObjectApi) DeleteAtPath added in v0.3.0

func (c MeshObjectApi) DeleteAtPath(ctx context.Context, id string, extraPath ...string) (err error)

func (MeshObjectApi) GetAtPath added in v0.3.0

func (c MeshObjectApi) GetAtPath[R any](ctx context.Context, id string, extraPath ...string) (R, error)

func (MeshObjectApi) ListSeqAs added in v0.3.0

func (c MeshObjectApi) ListSeqAs[T any](ctx context.Context, listOptions ListOptions, options ...http.RequestOption) iter.Seq2[T, error]

func (MeshObjectApi) MeshObjectMimeType added in v0.3.0

func (c MeshObjectApi) MeshObjectMimeType() string

func (MeshObjectApi) PostAtPath added in v0.3.0

func (c MeshObjectApi) PostAtPath[R, P any](ctx context.Context, payload P, extraPath ...string) (R, error)

type MeshObjectClient

type MeshObjectClient[M any] struct {
	MeshObjectApi
}

MeshObjectClient decodes the API's objects into M, whose type name gives the kind.

func NewMeshObjectClient

func NewMeshObjectClient[M any](ctx context.Context, httpClient HttpClient, apiVersion string, explicitApiPathElems ...string) MeshObjectClient[M]

NewMeshObjectClient takes the API path from the kind of M, in plural and lower case, unless explicitApiPathElems is given. Only the user and group binding APIs of workspaces and projects break that convention.

func (MeshObjectClient[M]) Delete

func (c MeshObjectClient[M]) Delete(ctx context.Context, id string) (err error)

func (MeshObjectClient[M]) Get

func (c MeshObjectClient[M]) Get(ctx context.Context, id string) (resp *M, err error)

func (MeshObjectClient[M]) List

func (c MeshObjectClient[M]) List(ctx context.Context, options ...http.RequestOption) ([]M, error)

func (MeshObjectClient[M]) ListSeq added in v0.2.0

func (c MeshObjectClient[M]) ListSeq(ctx context.Context, options ...http.RequestOption) iter.Seq2[M, error]

func (MeshObjectClient[M]) Post

func (c MeshObjectClient[M]) Post[P any](ctx context.Context, payload P) (*M, error)

func (MeshObjectClient[M]) Put

func (c MeshObjectClient[M]) Put[P any](ctx context.Context, id string, payload P) (*M, error)

type Page added in v0.2.0

type Page struct {
	Size          int `json:"size"`
	TotalElements int `json:"totalElements"`
	TotalPages    int `json:"totalPages"`
	Number        int `json:"number"`
}

Jump to

Keyboard shortcuts

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