userkv

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Overview

Package userkv provides a simple key-value store for users.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	Get(c echo.Context) error
	Upsert(c echo.Context) error
}

Handler is the interface for handling HTTP requests

func NewHandler

func NewHandler(service Service) Handler

NewHandler creates a new handler

type Repository

type Repository interface {
	Get(ctx context.Context, owner, key string) (string, error)
	Upsert(ctx context.Context, owner, key, value string) error
	Clean(ctx context.Context, ccid string) error
}

Repository is the interface for userkv repository

func NewRepository

func NewRepository(db *gorm.DB) Repository

NewRepository creates a new userkv repository

type Service

type Service interface {
	Get(ctx context.Context, userID string, key string) (string, error)
	Upsert(ctx context.Context, userID string, key string, value string) error
	Clean(ctx context.Context, ccid string) error
}

Service is the interface for userkv service

func NewService

func NewService(repository Repository) Service

NewService creates a new userkv service

Directories

Path Synopsis
Package mock_userkv is a generated GoMock package.
Package mock_userkv is a generated GoMock package.

Jump to

Keyboard shortcuts

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