app

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPath   = defaultConfigFile
	DefaultSchema = defaultConfigSchema
)

Variables

View Source
var DefaultDiscoveryOrder = []string{
	defaultConfigFile,
	"moltnet.yaml",
	"moltnet.yml",
	"moltnet.json",
}

Functions

func DiscoverPath

func DiscoverPath(explicit string) (string, bool, error)

Types

type App

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

func New

func New(config Config) (*App, error)

func (*App) Close added in v0.0.2

func (a *App) Close() error

func (*App) Handler added in v0.0.2

func (a *App) Handler() http.Handler

func (*App) Run

func (a *App) Run(ctx context.Context) error

type Config

type Config struct {
	AllowHumanIngress     bool
	DisableDirectMessages bool
	Auth                  authn.Config
	ListenAddr            string
	NetworkID             string
	NetworkName           string
	Pairings              []protocol.Pairing
	Rooms                 []RoomConfig
	Storage               StorageConfig
	Version               string
}

func ConfigFromEnv

func ConfigFromEnv(version string) (Config, error)

func LoadConfig

func LoadConfig(version string) (Config, error)

func LoadFile

func LoadFile(path string, version string) (Config, error)

type JSONStorageConfig

type JSONStorageConfig struct {
	Path string `json:"path,omitempty" yaml:"path,omitempty"`
}

type PostgresStorageConfig

type PostgresStorageConfig struct {
	DSN string `json:"dsn,omitempty" yaml:"dsn,omitempty"`
}

type RoomConfig

type RoomConfig struct {
	ID      string   `json:"id" yaml:"id"`
	Name    string   `json:"name,omitempty" yaml:"name,omitempty"`
	Members []string `json:"members,omitempty" yaml:"members,omitempty"`
}

type SQLiteStorageConfig

type SQLiteStorageConfig struct {
	Path string `json:"path,omitempty" yaml:"path,omitempty"`
}

type StorageConfig

type StorageConfig struct {
	Kind     string                `json:"kind" yaml:"kind"`
	JSON     JSONStorageConfig     `json:"json,omitempty" yaml:"json,omitempty"`
	SQLite   SQLiteStorageConfig   `json:"sqlite,omitempty" yaml:"sqlite,omitempty"`
	Postgres PostgresStorageConfig `json:"postgres,omitempty" yaml:"postgres,omitempty"`
}

Jump to

Keyboard shortcuts

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