persistence

package
v0.0.1-0...-6deec57 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package persistence holds view models and repository interfaces

Package persistence holds view models and repository interfaces

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetID() string
	GetUserID() string
	GetSecret() string
	GetDomain() string
	GetRedirectURL() string
	GetScopes() []string
}

Client the client persistence model interface

type ClientRepository

type ClientRepository interface {
	Get(ctx context.Context, id string) (Client, error)
	Add(ctx context.Context, client Client) error
	Delete(ctx context.Context, id string) error

	// GetByID Calls Get method and returns oauth2 client info
	// Implements client store interface
	GetByID(ctx context.Context, id string) (oauth2.ClientInfo, error)

	CountByUserID(ctx context.Context, userID string) (int64, error)
	FindAllByUserID(ctx context.Context, userID string, limit, offset int64) ([]Client, error)
}

ClientRepository allows to get/save current state of user to memory storage

type Token

type Token interface {
	GetID() string
	GetUserAgent() string
	GetData() json.RawMessage
	TokenInfo() (oauth2.TokenInfo, error)
}

Token the token persistence model interface

type TokenRepository

type TokenRepository interface {
	Get(ctx context.Context, id string) (Token, error)
	GetByCode(ctx context.Context, code string) (Token, error)
	GetByAccess(ctx context.Context, access string) (Token, error)
	GetByRefresh(ctx context.Context, refresh string) (Token, error)
	Add(ctx context.Context, token Token) error
	Delete(ctx context.Context, id string) error

	CountByClientID(ctx context.Context, clientID string) (int64, error)
	FindAllByClientID(ctx context.Context, clientID string, limit, offset int64) ([]Token, error)
}

TokenRepository allows to get/save current state of token to memory storage

Directories

Path Synopsis
Package mysql holds view model repositories Package mysql holds view model repositories Package mysql holds view model repositories Package mysql holds view model repositories
Package mysql holds view model repositories Package mysql holds view model repositories Package mysql holds view model repositories Package mysql holds view model repositories

Jump to

Keyboard shortcuts

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