webhandlers

package
v0.27.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SessionTableColumns = []web.Column{
	{
		Name:       "Session",
		Sortable:   true,
		OrderByKey: "session_id",
	},
	{
		Name:       "User",
		Sortable:   true,
		OrderByKey: "user_id",
	},
	{
		Name:       "Created",
		Sortable:   true,
		OrderByKey: "created_at",
	},
}
View Source
var UserTableColumns = []web.Column{
	{
		Name:       "User",
		Sortable:   true,
		OrderByKey: "user_id",
	},
	{
		Name:       "Email",
		Sortable:   true,
		OrderByKey: "email",
	},
	{
		Name:       "Sessions",
		Sortable:   false,
		OrderByKey: "session_count",
	},
	{
		Name:       "Created",
		Sortable:   true,
		OrderByKey: "created_at",
	},
}

Functions

func DeleteCollectionHandler

func DeleteCollectionHandler(appState *models.AppState) http.HandlerFunc

func DeleteSessionHandler

func DeleteSessionHandler(appState *models.AppState) http.HandlerFunc

func DeleteUserHandler

func DeleteUserHandler(appState *models.AppState) http.HandlerFunc

func GetCollectionListHandler

func GetCollectionListHandler(appState *models.AppState) http.HandlerFunc

func GetSessionDetailsHandler

func GetSessionDetailsHandler(appState *models.AppState) http.HandlerFunc

func GetSessionListHandler

func GetSessionListHandler(appState *models.AppState) http.HandlerFunc

func GetSettingsHandler

func GetSettingsHandler(appState *models.AppState) http.HandlerFunc

func GetUserDetailsHandler

func GetUserDetailsHandler(appState *models.AppState) http.HandlerFunc

func GetUserListHandler

func GetUserListHandler(appState *models.AppState) http.HandlerFunc

func IndexCollectionHandler

func IndexCollectionHandler(appState *models.AppState) http.HandlerFunc

func IndexHandler

func IndexHandler(w http.ResponseWriter, r *http.Request)

func NotFoundHandler

func NotFoundHandler() http.HandlerFunc

func PostUserDetailsHandler

func PostUserDetailsHandler(appState *models.AppState) http.HandlerFunc

func ViewCollectionHandler

func ViewCollectionHandler(appState *models.AppState) http.HandlerFunc

Types

type CollectionDetails

type CollectionDetails struct {
	*models.DocumentCollection
}

type CollectionList

type CollectionList struct {
	DocumentStore models.DocumentStore[*bun.DB]
	Collections   []models.DocumentCollection
	TotalCount    int
	Cursor        int64
	Limit         int64
}

func NewCollectionList

func NewCollectionList(
	documentStore models.DocumentStore[*bun.DB],
	cursor int64,
	limit int64,
) *CollectionList

func (*CollectionList) Get

type ConfigData

type ConfigData struct {
	ConfigHTML   template.HTML
	ConfigString string
}

type SessionDetails

type SessionDetails struct {
	MemoryStore models.MemoryStore[*bun.DB]
	SessionID   string
	Session     *models.Session
	Messages    []models.Message
	*web.Table
}

func NewSessionDetails

func NewSessionDetails(
	memoryStore models.MemoryStore[*bun.DB],
	r *http.Request,
	sessionID string,
) *SessionDetails

func (*SessionDetails) Get

type SessionList

type SessionList struct {
	MemoryStore models.MemoryStore[*bun.DB]
	UserID      string
	*web.Table
}

func NewSessionList

func NewSessionList(
	memoryStore models.MemoryStore[*bun.DB], r *http.Request, userID string,
) *SessionList

func (*SessionList) Get

func (sl *SessionList) Get(ctx context.Context, appState *models.AppState) error

type UserFormData

type UserFormData struct {
	models.User
	MetadataString string
	*SessionList
}

type UserList

type UserList struct {
	UserStore models.UserStore
	*web.Table
}

func NewUserList

func NewUserList(userStore models.UserStore, r *http.Request) *UserList

func (*UserList) Get

func (u *UserList) Get(ctx context.Context) error

type UserRow

type UserRow struct {
	*models.User
	SessionCount int
}

Jump to

Keyboard shortcuts

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