servers

package
v0.0.0-...-3900cc6 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSchema

func CreateSchema(server string, env []Env) ([]Env, Schema)

Types

type About

type About struct {
	Title       string `yaml:"title,omitempty" json:"title,omitempty"`
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
	Icon        string `yaml:"icon,omitempty" json:"icon,omitempty"`
}

type AnyOf

type AnyOf struct {
	Required []string `yaml:"required,omitempty" json:"required,omitempty"`
}

type Config

type Config struct {
	Description string   `yaml:"description,omitempty" json:"description,omitempty"`
	Secrets     []Secret `yaml:"secrets,omitempty" json:"secrets,omitempty"`
	Env         []Env    `yaml:"env,omitempty" json:"env,omitempty"`
	Parameters  Schema   `yaml:"parameters,omitempty" json:"parameters,omitempty"`
	AnyOf       []AnyOf  `yaml:"anyOf,omitempty" json:"anyOf,omitempty"`
}

type Container

type Container struct {
	Image   string   `yaml:"image,omitempty" json:"image,omitempty"`
	Command []string `yaml:"command,omitempty" json:"command,omitempty"`
	Volumes []string `yaml:"volumes,omitempty" json:"volumes,omitempty"`
}

type Dynamic

type Dynamic struct {
	Tools bool `yaml:"tools,omitempty" json:"tools,omitempty"`
}

type Env

type Env struct {
	Name    string `yaml:"name" json:"name"`
	Example any    `yaml:"example,omitempty" json:"example,omitempty"`
	Value   string `yaml:"value,omitempty" json:"value,omitempty"`
}

type Items

type Items struct {
	Type string `yaml:"type" json:"type"`
}

type Meta

type Meta struct {
	Category string   `yaml:"category,omitempty" json:"category,omitempty"`
	Tags     []string `yaml:"tags,omitempty" json:"tags,omitempty"`
}

type OAuthProvider

type OAuthProvider struct {
	Provider string `yaml:"provider,omitempty" json:"provider,omitempty"`
	Secret   string `yaml:"secret,omitempty" json:"secret,omitempty"`
	Env      string `yaml:"env,omitempty" json:"env,omitempty"`
}

type Parameters

type Parameters struct {
	Type       string     `yaml:"type" json:"type"`
	Properties Properties `yaml:"properties" json:"properties"`
	Required   []string   `yaml:"required" json:"required"`
}

type Properties

type Properties map[string]Property

type Property

type Property struct {
	Type        string `yaml:"type" json:"type"`
	Description string `yaml:"description" json:"description"`
	Items       *Items `yaml:"items,omitempty" json:"items,omitempty"`
}

type Remote

type Remote struct {
	TransportType string            `yaml:"transport_type,omitempty" json:"transport_type,omitempty"`
	URL           string            `yaml:"url,omitempty" json:"url,omitempty"`
	Headers       map[string]string `yaml:"headers,omitempty" json:"headers,omitempty"`
}

type Run

type Run struct {
	Command        []string          `yaml:"command,omitempty" json:"command,omitempty"`
	Volumes        []string          `yaml:"volumes,omitempty" json:"volumes,omitempty"`
	User           string            `yaml:"user,omitempty" json:"user,omitempty"`
	Env            map[string]string `yaml:"env,omitempty" json:"env,omitempty"`
	AllowHosts     []string          `yaml:"allowHosts,omitempty" json:"allowHosts,omitempty"`
	DisableNetwork bool              `yaml:"disableNetwork,omitempty" json:"disableNetwork,omitempty"`
}

type Schema

type Schema struct {
	Type        string     `yaml:"type" json:"type"`
	Description string     `yaml:"description,omitempty" json:"description,omitempty"`
	Properties  SchemaList `yaml:"properties,omitempty" json:"properties,omitempty"`
	Required    []string   `yaml:"required,omitempty" json:"required,omitempty"`
	Items       Items      `yaml:"items,omitempty" json:"items,omitempty"`
	AnyOf       []AnyOf    `yaml:"anyOf,omitempty" json:"anyOf,omitempty"`
	Default     any        `yaml:"default,omitempty" json:"default,omitempty"`
}

type SchemaEntry

type SchemaEntry struct {
	Schema Schema `yaml:",inline"`
	Name   string `yaml:"name"`
}

type SchemaList

type SchemaList []SchemaEntry

func (SchemaList) MarshalYAML

func (tl SchemaList) MarshalYAML() (interface{}, error)

func (*SchemaList) UnmarshalYAML

func (tl *SchemaList) UnmarshalYAML(value *yaml.Node) error

type Secret

type Secret struct {
	Name        string `yaml:"name" json:"name"`
	Env         string `yaml:"env" json:"env"`
	Example     string `yaml:"example,omitempty" json:"example,omitempty"`
	Description string `yaml:"description,omitempty" json:"description,omitempty"`
	Required    *bool  `yaml:"required,omitempty" json:"required,omitempty"`
}

func (Secret) MarshalJSON

func (s Secret) MarshalJSON() ([]byte, error)

func (Secret) MarshalYAML

func (s Secret) MarshalYAML() (any, error)

type Server

type Server struct {
	Name        string          `yaml:"name" json:"name"`
	Image       string          `yaml:"image,omitempty" json:"image,omitempty"`
	Type        string          `yaml:"type" json:"type"`
	Dynamic     *Dynamic        `yaml:"dynamic,omitempty" json:"dynamic,omitempty"`
	LongLived   bool            `yaml:"longLived,omitempty" json:"longLived,omitempty"`
	Meta        Meta            `yaml:"meta,omitempty" json:"meta,omitempty"`
	About       About           `yaml:"about,omitempty" json:"about,omitempty"`
	Source      Source          `yaml:"source,omitempty" json:"source,omitempty"`
	Remote      Remote          `yaml:"remote,omitempty" json:"remote,omitempty"`
	Run         Run             `yaml:"run,omitempty" json:"run,omitempty"`
	Config      Config          `yaml:"config,omitempty" json:"config,omitempty"`
	OAuth       []OAuthProvider `yaml:"oauth,omitempty" json:"oauth,omitempty"`
	Tools       []Tool          `yaml:"tools,omitempty" json:"tools,omitempty"`
	Requirement string          `yaml:"requirement,omitempty" json:"requirement,omitempty"`
}

func Read

func Read(path string) (Server, error)

func (*Server) GetBranch

func (s *Server) GetBranch() string

func (*Server) GetContext

func (s *Server) GetContext() string

func (*Server) GetDockerfile

func (s *Server) GetDockerfile() string

func (*Server) GetDockerfileUrl

func (s *Server) GetDockerfileUrl() string

func (*Server) GetSourceURL

func (s *Server) GetSourceURL() string

func (*Server) GetUpstream

func (s *Server) GetUpstream() string

type Source

type Source struct {
	Project     string `yaml:"project,omitempty" json:"project,omitempty"`
	Upstream    string `yaml:"upstream,omitempty" json:"upstream,omitempty"`
	Branch      string `yaml:"branch,omitempty" json:"branch,omitempty"`
	Commit      string `yaml:"commit,omitempty" json:"commit,omitempty"`
	Directory   string `yaml:"directory,omitempty" json:"directory,omitempty"`
	Dockerfile  string `yaml:"dockerfile,omitempty" json:"dockerfile,omitempty"`
	BuildTarget string `yaml:"buildTarget,omitempty" json:"buildTarget,omitempty"`
}

type Tool

type Tool struct {
	Name        string     `yaml:"name" json:"name"`
	Description string     `yaml:"description,omitempty" json:"description,omitempty"`
	Parameters  Parameters `yaml:"parameters,omitempty" json:"parameters,omitempty"`
	Container   Container  `yaml:"container,omitempty" json:"container,omitempty"`
}

Jump to

Keyboard shortcuts

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