resolver

package
v2.0.13 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildBaseFilter

func BuildBaseFilter(client *config.Client, groups ...string) ([]types.Query, error)

func CheckJWTValid added in v2.0.10

func CheckJWTValid(tokenstring string, secret string, alg []string, maxAge time.Duration) (map[string]interface{}, error)

func DecodeCursor

func DecodeCursor(s string) (*cursor, error)

func GetClaim added in v2.0.10

func GetClaim(claim map[string]interface{}, name string) (string, error)

func NewCursor

func NewCursor(from, size int) *cursor

Types

type ElasticResolver

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

func NewElasticResolver

func NewElasticResolver(elastic *elasticsearch.TypedClient, index string, clients []*config.Client, logger zLogger.ZLogger) *ElasticResolver

func (*ElasticResolver) MediathekEntries

func (r *ElasticResolver) MediathekEntries(ctx context.Context, signatures []string) ([]*model.MediathekFullEntry, error)

MediathekEntries is the resolver for the mediathekEntries field.

func (*ElasticResolver) ReferencesFull

func (*ElasticResolver) Search

func (r *ElasticResolver) Search(
	ctx context.Context,
	query string,
	facets []*model.InFacet,
	filter []*model.InFilter,
	vector []float64,
	first *int, size *int, cursor *string,
	sort []*model.SortField) (*model.SearchResult, error)

Search is the resolver for the search field.

type Resolver

type Resolver interface {
	// Search is the resolver for the search field.
	Search(ctx context.Context, query string, facets []*model.InFacet, filter []*model.InFilter, vector []float64, first *int, size *int, cursor *string, sort []*model.SortField) (*model.SearchResult, error)

	// MediathekEntries is the resolver for the mediathekEntries field.
	MediathekEntries(ctx context.Context, signatures []string) ([]*model.MediathekFullEntry, error)

	ReferencesFull(ctx context.Context, obj *model.MediathekFullEntry) ([]*model.MediathekBaseEntry, error)
}

func NewBadgerResolver

func NewBadgerResolver(logger zLogger.ZLogger, db *badger.DB) Resolver

type User added in v2.0.10

type User struct {
	Id        string    `json:"Id"`
	Groups    []string  `json:"Groups"`
	Email     string    `json:"email"`
	FirstName string    `json:"firstName"`
	LastName  string    `json:"lastName"`
	HomeOrg   string    `json:"homeOrg"`
	Exp       time.Time `json:"exp"`
	LoggedIn  bool      `json:"loggedIn"`
	LoggedOut bool      `json:"loggedOut"`
}

func NewGuestUser added in v2.0.10

func NewGuestUser() *User

Jump to

Keyboard shortcuts

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