server

package
v0.0.0-...-ab45ee7 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrGuildNotFound = errors.New("guild not found")

ErrGuildNotFound ...

Functions

This section is empty.

Types

type RPCServer

type RPCServer struct {
	Bot *bcr.Router
	DB  *db.DB

	proto.UnimplementedGuildInfoServiceServer
	// contains filtered or unexported fields
}

RPCServer is a gRPC server

func NewServer

func NewServer(bot *bcr.Router, db *db.DB, clearCacheFunc func(discord.GuildID, ...discord.ChannelID), memberCountFunc func() int64, guildPermFunc func(discord.GuildID, discord.UserID) (discord.Guild, discord.Permissions, error), joinedFunc func(discord.GuildID) bool) *RPCServer

NewServer creates a new RPCServer, starts it, and returns it

func (*RPCServer) ClearCache

ClearCache ...

func (*RPCServer) Guild

func (s *RPCServer) Guild(ctx context.Context, req *proto.GuildRequest) (resp *proto.GuildResponse, err error)

Guild gets basic guild info from the server, including a channel list.

func (*RPCServer) GuildUserCount

func (s *RPCServer) GuildUserCount(ctx context.Context, req *proto.GuildUserCountRequest) (resp *proto.GuildUserCountResponse, err error)

GuildUserCount gets the guild and user count

func (*RPCServer) UserGuildList

func (s *RPCServer) UserGuildList(_ context.Context, req *proto.UserGuildListRequest) (resp *proto.UserGuildListResponse, err error)

UserGuildList returns a list of guilds with info if they're joined or not.

Jump to

Keyboard shortcuts

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