coflnet

package
v0.0.0-...-b986d7c Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PaymentTraceName = "payment-api"
)

Variables

This section is empty.

Functions

func LoadUser

func LoadUser(mcUser *model.User) (*model.User, error)

func LoadUserById

func LoadUserById(id int) (*model.User, error)

UserById loads a user, potentially cached

func LoadUserByUUID

func LoadUserByUUID(uuid string) (*model.User, error)

func MutePlayer

func MutePlayer(mute *model.Mute) (time.Time, error)

MutePlayer sends a mute request to the cofl chat service and saves the mute in the internal database

func PlayerName

func PlayerName(uuid string) (string, error)

func PlayerNameHost

func PlayerNameHost() string

func PlayerUUIDByName

func PlayerUUIDByName(name string) (string, error)

func UnmutePlayer

func UnmutePlayer(unmute *model.Unmute) error

Types

type ApiClient

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

func NewApiClient

func NewApiClient() *ApiClient

func (*ApiClient) SearchUUIDForPlayer

func (m *ApiClient) SearchUUIDForPlayer(ctx context.Context, username string) ([]string, error)

type ChatApi

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

func NewChatApi

func NewChatApi() *ChatApi

func (*ChatApi) MuteUser

func (a *ChatApi) MuteUser(ctx context.Context, uuidTarget, muter, message, reason string) (*chat.Mute, error)

func (*ChatApi) SendMessage

func (r *ChatApi) SendMessage(ctx context.Context, msg string, playerUUID string, coflDiscordClientName string, playerName string) error

func (*ChatApi) UnmuteUser

func (a *ChatApi) UnmuteUser(ctx context.Context) (*chat.UnMute, error)

type McConnectApi

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

func NewMcConnectApi

func NewMcConnectApi() *McConnectApi

func (*McConnectApi) GetPlayer

func (a *McConnectApi) GetPlayer(ctx context.Context, id int) (*mcconnect.User, error)

func (*McConnectApi) PlayerByUUID

func (a *McConnectApi) PlayerByUUID(ctx context.Context, uuid string) (*mcconnect.User, error)

type MuteRequest

type MuteRequest struct {
	Uuid    string    `json:"uuid"`
	Muter   string    `json:"muter"`
	Reason  string    `json:"reason"`
	Expires time.Time `json:"expires"`
	Message string    `json:"message"`
}

type MuteResponse

type MuteResponse struct {
	UUID           string `json:"uuid"`
	Muter          string `json:"muter"`
	UnMuter        string `json:"unMuter"`
	Message        string `json:"message"`
	Reason         string `json:"reason"`
	ClientID       int    `json:"clientId"`
	UnMuteClientID int    `json:"unMuteClientId"`
	Timestamp      string `json:"timestamp"`
	Expires        string `json:"expires"`
	Status         int    `json:"status"`
}

type PaymentApi

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

func NewPaymentApi

func NewPaymentApi() *PaymentApi

func (*PaymentApi) OwningTimeProductOfUser

func (p *PaymentApi) OwningTimeProductOfUser(ctx context.Context, userId int, productSlug string) (time.Time, error)

func (*PaymentApi) OwningTimesOfUser

func (p *PaymentApi) OwningTimesOfUser(ctx context.Context, userId int) ([]model.OwnedProducts, error)

type UnMuteRequest

type UnMuteRequest struct {
	Unmuter string `json:"unMuter"`
	Reason  string `json:"reason"`
	Uuid    string `json:"uuid"`
}

Jump to

Keyboard shortcuts

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