sqlstore

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlacklistRepository added in v0.0.14

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

BlacklistRepository is responsible for black list.

func (*BlacklistRepository) FindByIPv4 added in v0.0.14

func (r *BlacklistRepository) FindByIPv4(ipv4 string) (*model.BlackListItem, error)

FindByIPv4 returns full information about the blacklisted record method by unique id.

type Store

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

Store is an implementation of store.Store interface based on PostgreSQL.

func New

func New(host string, port int, user, password, dbname, sslmode string) (*Store, error)

New returns newly allocated store.

func (*Store) Blacklist added in v0.0.14

func (s *Store) Blacklist() domain.BlackListRepository

Blacklist returns repository responsible for blacklisted items.

func (*Store) Token

func (s *Store) Token() domain.TokenRepository

Token returns repository responsible for tokens.

type TokenRepository

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

TokenRepository is responsible for tokens.

func (*TokenRepository) Create added in v0.0.21

func (r *TokenRepository) Create(ctx context.Context, token *model.Token) error

func (*TokenRepository) DeleteByID added in v0.0.21

func (r *TokenRepository) DeleteByID(ctx context.Context, id string) error

func (*TokenRepository) FindByID

func (r *TokenRepository) FindByID(ctx context.Context, id string) (*model.Token, error)

FindByID returns full information about the auth method by uniqnue id.

func (*TokenRepository) FindBySecret added in v0.0.21

func (r *TokenRepository) FindBySecret(ctx context.Context, secret string) (*model.Token, error)

FindBySecret returns full information about the auth method by uniqnue secret.

func (*TokenRepository) List added in v0.0.21

func (*TokenRepository) Update added in v0.0.21

func (r *TokenRepository) Update(ctx context.Context, token *model.Token) error

Jump to

Keyboard shortcuts

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