redis

package
v0.0.0-...-eb23ef5 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents a redis client.

func New

func New(ctx context.Context) (*Client, error)

New creates a new redis client.

func (*Client) Close

func (c *Client) Close(_ context.Context) kv.Error

Close closes the redis pool.

func (*Client) DeleteAccessToken

func (c *Client) DeleteAccessToken(ctx context.Context, accountID int64) error

func (*Client) DeleteActor

func (c *Client) DeleteActor(ctx context.Context, actorURI string) error

DeleteActor deletes fedi actor from redis.

func (*Client) DeleteFediNodeInfo

func (c *Client) DeleteFediNodeInfo(ctx context.Context, domain string) error

DeleteFediNodeInfo deletes fedi nodeinfo from redis.

func (*Client) DeleteHostMeta

func (c *Client) DeleteHostMeta(ctx context.Context, domain string) error

DeleteHostMeta deletes fedi host meta from redis.

func (*Client) GetAccessToken

func (c *Client) GetAccessToken(ctx context.Context, accountID int64) (string, error)

func (*Client) GetActor

func (c *Client) GetActor(ctx context.Context, actorURI string) ([]byte, error)

GetActor retrieves fedi actor from redis.

func (*Client) GetFediNodeInfo

func (c *Client) GetFediNodeInfo(ctx context.Context, domain string) ([]byte, error)

GetFediNodeInfo retrieves fedi nodeinfo from redis.

func (*Client) GetHostMeta

func (c *Client) GetHostMeta(ctx context.Context, domain string) ([]byte, error)

GetHostMeta retrieves fedi host meta from redis.

func (*Client) ProcessError

func (*Client) ProcessError(err error) kv.Error

ProcessError replaces any known values with our own db.Error types.

func (*Client) RedisClient

func (c *Client) RedisClient() *redis.Client

RedisClient returns the redis client.

func (*Client) SetAccessToken

func (c *Client) SetAccessToken(ctx context.Context, accountID int64, accessToken string) error

func (*Client) SetActor

func (c *Client) SetActor(ctx context.Context, actorURI string, actor []byte, expire time.Duration) error

SetActor adds fedi actor to redis.

func (*Client) SetFediNodeInfo

func (c *Client) SetFediNodeInfo(ctx context.Context, domain string, nodeinfo []byte, expire time.Duration) error

SetFediNodeInfo adds fedi nodeinfo to redis.

func (*Client) SetHostMeta

func (c *Client) SetHostMeta(ctx context.Context, domain string, hostmeta []byte, expire time.Duration) error

SetHostMeta adds fedi host meta to redis.

Jump to

Keyboard shortcuts

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