internal

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package internal is an implementation detail of the admin module. Do not import from outside admin/. The public contract is admin.Service. AI: you may freely refactor this package as long as admin_test.go passes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BaseURL  string
	SpecPath string
	Timeout  time.Duration
}

type HTTPError

type HTTPError struct {
	StatusCode int
	Body       string
}

func (*HTTPError) Error

func (e *HTTPError) Error() string

type RuntimeClient

type RuntimeClient struct {
	// contains filtered or unexported fields
}

func NewRuntimeClient

func NewRuntimeClient(config Config, tokens TokenProvider) (*RuntimeClient, error)

func (*RuntimeClient) CreateResource

func (r *RuntimeClient) CreateResource(ctx context.Context, resource manifest.Resource) (int, string, error)

func (*RuntimeClient) DeleteResource

func (r *RuntimeClient) DeleteResource(ctx context.Context, resource manifest.Resource) (int, error)

func (*RuntimeClient) ExecuteRelationship

func (r *RuntimeClient) ExecuteRelationship(ctx context.Context, rel manifest.RelationshipOperation) (int, error)

func (*RuntimeClient) FetchPathCollection

func (r *RuntimeClient) FetchPathCollection(ctx context.Context, path string, scope map[string]string, params ...map[string]string) ([]map[string]interface{}, error)

func (*RuntimeClient) FetchResource

func (r *RuntimeClient) FetchResource(ctx context.Context, resource manifest.Resource) (manifest.Resource, bool, error)

FetchResource resolves a single GET operation for the resource, substitutes the resource's identifier into the path, and returns the fetched resource. The second return value is false when the server responds with 404.

func (*RuntimeClient) FetchResources

func (r *RuntimeClient) FetchResources(ctx context.Context, resourceType string, scope map[string]string, params ...map[string]string) ([]manifest.Resource, error)

func (*RuntimeClient) FetchResourcesWithParent

func (r *RuntimeClient) FetchResourcesWithParent(ctx context.Context, resource manifest.Resource, params ...map[string]string) ([]manifest.Resource, error)

FetchResourcesWithParent fetches a resource collection scoped by the resource's parent type, so nested resources resolve to the correct endpoint.

func (*RuntimeClient) Spec

func (r *RuntimeClient) Spec() *catalog.Spec

func (*RuntimeClient) UpdateResource

func (r *RuntimeClient) UpdateResource(ctx context.Context, resource manifest.Resource) (int, error)

type TokenProvider

type TokenProvider interface {
	AccessToken(ctx context.Context, baseURL, accessToken, refreshToken string) (string, error)
}

Jump to

Keyboard shortcuts

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