server

package
v2.0.18 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcAspectSize

func CalcAspectSize(width, height, maxWidth, maxHeight int64) size

func NewDefaultIndexFS

func NewDefaultIndexFS(fs http.FileSystem, indexFile string) http.FileSystem

func NewJWT added in v2.0.16

func NewJWT(secret string, subject string, alg string, valid int64, domain string, issuer string, userId string) (tokenString string, err error)

Types

type All added in v2.0.12

type All interface {
	// contains filtered or unexported methods
}

type CollFacetType added in v2.0.8

type CollFacetType struct {
	Id int64 `toml:"id" json:"id"`
	//Name       string `toml:"name" json:"name"`
	Count      int    `toml:"count" json:"count"`
	Title      string `toml:"title" json:"title"`
	Url        string `toml:"url" json:"url"`
	Identifier string `toml:"identifier" json:"identifier"`
	Image      string `toml:"image" json:"image"`
	Contact    string `toml:"contact" json:"contact"`
}

type Controller

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

func NewController

func NewController(localAddr, externalAddr, searchAddr, detailAddr string,
	protoHTTP bool,
	auth map[string]string,
	cert *tls.Certificate,
	templateFS, staticFS, dataFS fs.FS,
	client client.RevCatGraphQLClient,
	zoomPos map[string][]image.Rectangle,
	mediaserverBase string,
	mediaserverKey string,
	mediaserverTokenExp time.Duration,
	bundle *i18n.Bundle,
	collections []*CollFacetType,
	fieldMapping map[string]string,
	embeddings *openai.ClientV2,
	templateDebug, zoomOnly bool,
	loginURL string,
	loginIssuer string,
	loginJWTKey string,
	loginJWTAlgs []string,
	locations map[string][]net.IPNet,
	logger zLogger.ZLogger) (*Controller, error)

func (*Controller) AuthHandler added in v2.0.16

func (ctrl *Controller) AuthHandler(ctx *gin.Context)

func (*Controller) Start

func (ctrl *Controller) Start() error

func (*Controller) Stop

func (ctrl *Controller) Stop() error

type DefaultIndexFS

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

func (*DefaultIndexFS) Open

func (d *DefaultIndexFS) Open(name string) (http.File, error)

type Property added in v2.0.12

type Property struct {
	Key   string `@Ident ":"`
	Value string `@String | @Ident`
}

type Query added in v2.0.12

type Query struct {
	Items []All `( @@ " "?)*`
}

type String added in v2.0.12

type String struct {
	Value string `@String`
}

type User added in v2.0.16

type User struct {
	UserID    string   `json:"userId"`
	Email     string   `json:"email"`
	FirstName string   `json:"firstName"`
	LastName  string   `json:"lastName"`
	HomeOrg   string   `json:"homeOrg"`
	Groups    []string `json:"groups"`
}

func GetUser added in v2.0.16

func GetUser(ctx *gin.Context) *User

func (*User) IsLoggedIn added in v2.0.16

func (user *User) IsLoggedIn() bool

Jump to

Keyboard shortcuts

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