postgresql

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessHasher

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

AccessHasher is a PostgreSQL-backed channel access hasher.

func NewAccessHasher

func NewAccessHasher(pool *pgxpool.Pool, table string) *AccessHasher

NewAccessHasher creates a new AccessHasher for the given pool and table.

func (*AccessHasher) GetChannelAccessHash

func (h *AccessHasher) GetChannelAccessHash(ctx context.Context, userID, channelID int64) (int64, bool, error)

GetChannelAccessHash retrieves the access hash for a given user and channel.

func (*AccessHasher) SetChannelAccessHash

func (h *AccessHasher) SetChannelAccessHash(ctx context.Context, userID, channelID, accessHash int64) error

SetChannelAccessHash inserts or updates the access hash for a user and channel.

type Client

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

Client implements kv.Storage on top of PostgreSQL single table.

func (*Client) Get

func (c *Client) Get(ctx context.Context, _ string) (string, error)

Get retrieves the full JSONB data for the agent.

func (*Client) Set

func (c *Client) Set(ctx context.Context, _ string, sessionStr string) error

Set updates only the session_string field in the JSONB data column.

type SessionStorage

type SessionStorage struct {
	kv.Session
}

SessionStorage is a MTProto session PostgreSQL storage.

func NewSessionStorage

func NewSessionStorage(pool *pgxpool.Pool, id int64, table string) SessionStorage

NewSessionStorage creates new SessionStorage for a given id and table.

Jump to

Keyboard shortcuts

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