types

package
v0.0.0-...-78fecf6 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string

type AgentContent

type AgentContent struct {
	Id      string `json:"id"`
	Version int    `json:"version"`
	Content KV     `json:"content"`
}

type Data

type Data struct {
	Action  Action `json:"action"`
	Version int    `json:"version"`
	Content KV     `json:"content"`
}

type KV

type KV map[string]any

func (KV) Float64

func (j KV) Float64(key string) (float64, bool)

func (KV) Float64Value

func (j KV) Float64Value() (float64, bool)

func (KV) Int64

func (j KV) Int64(key string) (int64, bool)

func (KV) Int64Value

func (j KV) Int64Value() (int64, bool)

func (KV) Map

func (j KV) Map(key string) (map[string]any, bool)

func (*KV) Scan

func (j *KV) Scan(value any) error

func (KV) String

func (j KV) String(key string) (string, bool)

func (KV) StringValue

func (j KV) StringValue() (string, bool)

func (KV) Uint64

func (j KV) Uint64(key string) (uint64, bool)

func (KV) Uint64Value

func (j KV) Uint64Value() (uint64, bool)

type Response

type Response struct {
	// Execution status (success or failure), must be one of ok and failed,
	// indicating successful and unsuccessful execution, respectively.
	Status ResponseStatus `json:"status"`
	// The return code, which must conform to the return code rules defined later on this page
	RetCode int64 `json:"retcode,omitempty"`
	// Response data
	Data any `json:"data,omitempty"`
	// Error message, it is recommended to fill in a human-readable error message when the action fails to execute,
	// or an empty string when it succeeds.
	Message string `json:"message,omitempty"`
}

type ResponseStatus

type ResponseStatus string
const (
	Success ResponseStatus = "ok"
	Failed  ResponseStatus = "failed"

	SuccessCode = int64(0)
)

Jump to

Keyboard shortcuts

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