examples

package
v1.1.12 Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package examples 提供示例代码

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloudStorageDriverExample

func CloudStorageDriverExample()

CloudStorageDriverExample 展示云存储的基本用法

func DistributedWorkerExample

func DistributedWorkerExample()

DistributedWorkerExample 演示分布式工作进程

func LocalStorageExample

func LocalStorageExample()

LocalStorageExample 展示本地文件存储操作

func MonitorQueueExample

func MonitorQueueExample()

MonitorQueueExample 监控队列状态

func OrderProducerExample

func OrderProducerExample()

OrderProducerExample 演示订单生产者

func QueueEventIntegrationExample

func QueueEventIntegrationExample()

QueueEventIntegrationExample 展示队列与事件系统集成

func QueueExample

func QueueExample()

QueueExample 展示队列基本用法的示例

func QueueMiddlewareExample

func QueueMiddlewareExample()

QueueMiddlewareExample 展示队列中间件的使用

func RedisQueueExample

func RedisQueueExample()

RedisQueueExample 演示Redis队列的基本用法

func StorageExample

func StorageExample()

StorageExample 展示基本的文件存储操作

func WebSocketExample

func WebSocketExample()

WebSocketExample 展示WebSocket的基本用法

Types

type Config

type Config struct {
	GithubClientID     string
	GithubClientSecret string
	GoogleClientID     string
	GoogleClientSecret string
	WeChatAppID        string
	WeChatAppSecret    string
	BaseURL            string
}

应用程序配置

type User

type User struct {
	ID       int64
	Name     string
	Email    string
	Avatar   string
	Provider string
	SocialID string
}

User 代表应用程序中的用户模型

type UserRepository

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

UserRepository 实现了UserRepository接口

func (*UserRepository) CreateUser

func (r *UserRepository) CreateUser(ctx context.Context, user interface{}) error

CreateUser 创建新用户

func (*UserRepository) FindUserBySocialID

func (r *UserRepository) FindUserBySocialID(ctx context.Context, provider, socialID string) (interface{}, error)

FindUserBySocialID 通过社交平台ID查找用户

func (*UserRepository) GetUsers

func (r *UserRepository) GetUsers() []*User

GetUsers 返回所有用户

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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