app

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: May 19, 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)

func LoadApplyFile added in v0.1.12

func LoadApplyFile(path string) (protocol.ApplyConfigRequest, string, 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
	Console               ConsoleConfig
	DebugEvents           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 ConsoleAnalyticsConfig added in v0.1.11

type ConsoleAnalyticsConfig struct {
	Provider      string
	MeasurementID string
}

type ConsoleConfig added in v0.1.11

type ConsoleConfig struct {
	Analytics ConsoleAnalyticsConfig
}

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"`
	Visibility  string   `json:"visibility,omitempty" yaml:"visibility,omitempty"`
	WritePolicy string   `json:"write_policy,omitempty" yaml:"write_policy,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