interfaces

package
v0.1.3-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiController

type ApiController interface {
	Register(server *echo.Echo)
	GetControllerName() string
}

type App

type App struct {
	Db              *sql.DB
	Redis           *cache.RedisClient
	WapiClient      *wapi.Client
	Logger          slog.Logger
	Koa             *koanf.Koanf
	Fs              stuffbin.FileSystem
	Constants       *Constants
	CampaignManager *campaign_manager.CampaignManager
	AiService       *ai_service.AiService
}

type BasePlugin

type BasePlugin interface {
	Register(server echo.Echo) error
	Bootstrap(server echo.Echo) error
	GetConfig() PluginBaseConfig
}

type Constants

type Constants struct {
	SiteName              string `koanf:"site_name"`
	RootURL               string `koanf:"root_url"`
	LogoURL               string `koanf:"logo_url"`
	FaviconURL            string `koanf:"favicon_url"`
	AdminUsername         []byte `koanf:"admin_username"`
	AdminPassword         []byte `koanf:"admin_password"`
	IsDevelopment         bool
	IsProduction          bool
	RedisEventChannelName string `koanf:"redis_event_channel_name"`
	IsDebugModeEnabled    bool
}

type ContextSession

type ContextSession struct {
	Token string      `json:"token"`
	User  ContextUser `json:"user"`
}

type ContextUser

type ContextUser struct {
	Name           string                            `json:"name"`
	UniqueId       string                            `json:"unique_id"`
	Username       string                            `json:"username"`
	Email          string                            `json:"email"`
	Role           api_types.UserPermissionLevelEnum `json:"role"`
	OrganizationId string                            `json:"organization_id"`
}

type ContextWithSession

type ContextWithSession struct {
	echo.Context `json:",inline"`
	App          App            `json:"app,omitempty"`
	Session      ContextSession `json:"session,omitempty"`
}

type ContextWithoutSession

type ContextWithoutSession struct {
	echo.Context `json:",inline"`
	App          App `json:"app,omitempty"`
}

type Handler

type Handler interface {
	Handle(context echo.Context) error
}

type HandlerWithSession

type HandlerWithSession func(context ContextWithSession) error

func (HandlerWithSession) Handle

func (ch HandlerWithSession) Handle(context echo.Context) error

type HandlerWithoutSession

type HandlerWithoutSession func(context ContextWithoutSession) error

func (HandlerWithoutSession) Handle

func (eh HandlerWithoutSession) Handle(context echo.Context) error

type JwtPayload

type JwtPayload struct {
	ContextUser        `json:",inline"`
	jwt.StandardClaims `json:",inline"`
}

type PluginBaseConfig

type PluginBaseConfig struct {
	Name        string `json:"name"`
	RestApiPath string `json:"rest_api_path"`
}

type RateLimitConfig

type RateLimitConfig struct {
	MaxRequests    int   `json:"maxRequests"`
	WindowTimeInMs int64 `json:"windowTime"`
}

type Route

type Route struct {
	Path                    string `json:"path"`
	Method                  string `json:"method"`
	Handler                 Handler
	IsAuthorizationRequired bool
	MetaData                RouteMetaData `json:"metaData"`
}

type RouteMetaData

type RouteMetaData struct {
	PermissionRoleLevel api_types.UserPermissionLevelEnum `json:"permissionRoleLevel"`
	RequiredPermission  []api_types.RolePermissionEnum    `json:"requiredPermission"`
	RateLimitConfig     RateLimitConfig                   `json:"rateLimitConfig"`
}

type WebsocketEvent

type WebsocketEvent struct {
	Type string `json:"type"`
	Data string `json:"data"`
}

Jump to

Keyboard shortcuts

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