text

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	resources.ResourceConfigBase `yaml:",inline"`
	Text                         string `yaml:"text" validate:"required"`
}

Config represents the uninitialized textual resource configuration from YAML.

func (*Config) Initialize

func (c *Config) Initialize(ctx context.Context) (resources.Resource, error)

Initialize computes the size of the text and returns an initialized textual resource.

func (*Config) ResourceConfigType

func (c *Config) ResourceConfigType() string

ResourceConfigType returns the resource type identifier.

func (*Config) SetDefaults

func (c *Config) SetDefaults()

SetDefaults applies system defaults for unspecified optional fields.

type Resource

type Resource struct {
	Config
	Size int64
}

Resource represents the initialized textual resource that returns plain text payloads.

func (*Resource) GetSize

func (r *Resource) GetSize() *int64

GetSize returns the pre-computed size of the text content.

func (*Resource) Read

func (r *Resource) Read(ctx context.Context, params map[string]any) (any, error)

Read retrieves the static text content.

func (*Resource) ToConfig

func (r *Resource) ToConfig() resources.ResourceConfig

ToConfig returns the underlying uninitialized configuration.

Jump to

Keyboard shortcuts

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