service

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const API_KEY_SERVICE = "api_key"

Variables

This section is empty.

Functions

func NewAPIKeyService

func NewAPIKeyService() (core.Service, []core.ContextBuilderOption, error)

Types

type APIKeyService

type APIKeyService interface {
	core.Service
	CreateAPIKey(userID uint, name string) (*messages.CreateAPIKeyResponse, error)
	GetAPIKeys(userID uint, pagination *Pagination, filters map[string]interface{}, sorters []Sorter) (*messages.ListAPIKeyResponse, error)
	DeleteAPIKey(userID uint, uuid uuid.UUID) error
	ValidateAPIKey(key string) (*pluginDb.APIKey, error)
}

type APIKeyServiceDefault

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

func (*APIKeyServiceDefault) CreateAPIKey

func (s *APIKeyServiceDefault) CreateAPIKey(userID uint, name string) (*messages.CreateAPIKeyResponse, error)

func (*APIKeyServiceDefault) DeleteAPIKey

func (s *APIKeyServiceDefault) DeleteAPIKey(userID uint, keyID uuid.UUID) error

func (*APIKeyServiceDefault) GetAPIKeys

func (s *APIKeyServiceDefault) GetAPIKeys(userID uint, pagination *Pagination, filters map[string]interface{}, sorters []Sorter) (*messages.ListAPIKeyResponse, error)

func (*APIKeyServiceDefault) ID

func (s *APIKeyServiceDefault) ID() string

func (*APIKeyServiceDefault) ValidateAPIKey

func (s *APIKeyServiceDefault) ValidateAPIKey(key string) (*pluginDb.APIKey, error)

type Pagination

type Pagination struct {
	Page     int
	PageSize int
}

type Sorter

type Sorter struct {
	Field string
	Order string
}

Jump to

Keyboard shortcuts

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