Versions in this module Expand all Collapse all v0 v0.2.0 Nov 29, 2026 Changes in this version + type GridCell struct + Column int + Row int + func GridAt(mapSize uint32, x, y float32) (cell GridCell, ok bool) + func (g GridCell) String() string type ServerInfo + func (s ServerInfo) Grid(x, y float32) (GridCell, bool) v0.1.0 Nov 29, 2026 Changes in this version + const DefaultRelayURL + var ErrAccessDenied = &ServerError + var ErrAlreadyConnected = errors.New("rustplus: already connected") + var ErrAuthRejected = errors.New("rustplus: auth token rejected by relay") + var ErrAuthTokenExpired = errors.New("rustplus: auth token expired") + var ErrBanned = &ServerError + var ErrClosed = errors.New("rustplus: client closed") + var ErrConnectionLost = errors.New("rustplus: connection lost") + var ErrInvalidAuthToken = errors.New("rustplus: invalid auth token") + var ErrInvalidConfig = errors.New("rustplus: invalid config") + var ErrMessageNotSent = &ServerError + var ErrNoClan = &ServerError + var ErrNoPlayer = &ServerError + var ErrNoTeam = &ServerError + var ErrNotConnected = errors.New("rustplus: not connected; call Connect first") + var ErrNotFound = &ServerError + var ErrNotLeader = &ServerError + var ErrRateLimit = &ServerError + var ErrServerNotFound = errors.New("rustplus: server not found on relay") + var ErrUnexpectedResponse = errors.New("rustplus: unexpected response") + var ErrWrongType = &ServerError + func Redact(secret string) string + type Alarm struct + func (a Alarm) OnChanged(fn func(active bool)) (remove func()) + func (a Alarm) OnTriggered(fn func()) (remove func()) + func (a Alarm) State(ctx context.Context) (active bool, err error) + type AuthToken struct + ExpiresAt time.Time + IssuedAt time.Time + Raw string + SteamID uint64 + Version int + func ParseAuthToken(raw string) (AuthToken, error) + func (t AuthToken) Expired(now time.Time) bool + func (t AuthToken) GoString() string + func (t AuthToken) LogValue() slog.Value + func (t AuthToken) String() string + type Clan struct + func (cl Clan) Chat(ctx context.Context) ([]ClanMessage, error) + func (cl Clan) Info(ctx context.Context) (*ClanInfo, error) + func (cl Clan) OnChanged(fn func(*ClanInfo)) (remove func()) + func (cl Clan) OnMessage(fn func(ClanMessage)) (remove func()) + func (cl Clan) Send(ctx context.Context, message string) error + func (cl Clan) SetMotd(ctx context.Context, motd string) error + type ClanInfo struct + Color int32 + Created time.Time + Creator uint64 + ID int64 + Invites []ClanInvite + Logo []byte + MaxMemberCount int32 + Members []ClanMember + Motd string + MotdAuthor uint64 + MotdTimestamp time.Time + Name string + Roles []ClanRole + Score int64 + type ClanInvite struct + Recruiter uint64 + SteamID uint64 + Time time.Time + type ClanMember struct + Joined time.Time + LastSeen time.Time + Notes string + Online bool + RoleID int32 + SteamID uint64 + type ClanMessage struct + ClanID int64 + Message string + Name string + SteamID uint64 + Time time.Time + type ClanRole struct + CanAccessLogs bool + CanAccessScoreEvents bool + CanDemote bool + CanInvite bool + CanKick bool + CanPromote bool + CanSetLogo bool + CanSetMotd bool + CanSetPlayerNotes bool + ID int32 + Name string + Rank int32 + type Client struct + func Dial(ctx context.Context, cfg Config, opts ...Option) (*Client, error) + func New(cfg Config, opts ...Option) (*Client, error) + func (c *Client) Alarm(id uint64) Alarm + func (c *Client) Clan() Clan + func (c *Client) Close() error + func (c *Client) Connect(ctx context.Context) error + func (c *Client) Connected() bool + func (c *Client) Do(ctx context.Context, cost int, fill func(*rustpluspb.AppRequest)) (*rustpluspb.AppResponse, error) + func (c *Client) Done() <-chan struct{} + func (c *Client) Entity(id uint64) Entity + func (c *Client) Err() error + func (c *Client) Info(ctx context.Context) (ServerInfo, error) + func (c *Client) Map(ctx context.Context) (Map, error) + func (c *Client) Markers(ctx context.Context) ([]Marker, error) + func (c *Client) NexusAuth(ctx context.Context, appKey string) (NexusAuth, error) + func (c *Client) OnBroadcast(fn func(*rustpluspb.AppBroadcast)) (remove func()) + func (c *Client) OnDisconnected(fn func(err error)) (remove func()) + func (c *Client) OnEntityChanged(fn func(EntityChanged)) (remove func()) + func (c *Client) OnReconnected(fn func()) (remove func()) + func (c *Client) PlayerID() uint64 + func (c *Client) StorageMonitor(id uint64) StorageMonitor + func (c *Client) Switch(id uint64) Switch + func (c *Client) Team() Team + func (c *Client) Time(ctx context.Context) (GameTime, error) + type Config struct + AuthToken string + PlayerID uint64 + PlayerToken int32 + ServerID string + func (c Config) GoString() string + func (c Config) LogValue() slog.Value + func (c Config) String() string + type Entity struct + func (e Entity) ID() uint64 + func (e Entity) Info(ctx context.Context) (EntityInfo, error) + func (e Entity) Notifications(ctx context.Context) (bool, error) + func (e Entity) OnChanged(fn func(EntityPayload)) (remove func()) + func (e Entity) SetNotifications(ctx context.Context, enabled bool) error + type EntityChanged struct + EntityID uint64 + Payload EntityPayload + type EntityInfo struct + Payload EntityPayload + Type EntityType + type EntityPayload struct + Capacity int32 + HasProtection bool + Items []Item + ProtectionExpiry time.Time + Value bool + type EntityType int32 + const EntityAlarm + const EntityStorageMonitor + const EntitySwitch + func (t EntityType) String() string + type GameTime struct + DayLengthMinutes float32 + Sunrise float32 + Sunset float32 + Time float32 + TimeScale float32 + func (t GameTime) Clock() string + func (t GameTime) IsDay() bool + type HandshakeError struct + Err error + StatusCode int + func (e *HandshakeError) Error() string + func (e *HandshakeError) Unwrap() error + type Item struct + Blueprint bool + ItemID int32 + Quantity int32 + type Map struct + Background string + Height uint32 + JPG []byte + Monuments []Monument + OceanMargin int32 + Width uint32 + type MapNote struct + ColourIndex int32 + Icon int32 + Label string + Type int32 + X float32 + Y float32 + type Marker struct + Alpha float32 + Color1 Vector4 + Color2 Vector4 + ID uint64 + Name string + OutOfStock bool + Radius float32 + Rotation float32 + SellOrders []SellOrder + SteamID uint64 + Type MarkerType + X float32 + Y float32 + type MarkerType int32 + const MarkerCH47 + const MarkerCargoShip + const MarkerCrate + const MarkerExplosion + const MarkerGenericRadius + const MarkerPatrolHelicopter + const MarkerPlayer + const MarkerTravellingVendor + const MarkerUndefined + const MarkerVendingMachine + func (t MarkerType) String() string + type Monument struct + IsCustomName bool + Token string + X float32 + Y float32 + type NexusAuth struct + PlayerToken int32 + ServerID string + type Option func(*options) + func WithAuthTokenSource(fn func(ctx context.Context) (string, error)) Option + func WithEventBuffer(n int) Option + func WithHTTPClient(c *http.Client) Option + func WithHTTPHeader(key, value string) Option + func WithLogger(l *slog.Logger) Option + func WithMaxMessageSize(n int64) Option + func WithOrigin(origin string) Option + func WithPanicHandler(fn func(recovered any)) Option + func WithPingInterval(d time.Duration) Option + func WithReconnect(p ReconnectPolicy) Option + func WithRelayURL(u string) Option + func WithRequestTimeout(d time.Duration) Option + func WithoutExpiryCheck() Option + func WithoutRateLimit() Option + func WithoutReconnect() Option + type ReconnectPolicy struct + DialTimeout time.Duration + InitialDelay time.Duration + MaxAttempts int + MaxDelay time.Duration + func DefaultReconnectPolicy() ReconnectPolicy + type SellOrder struct + AmountInStock int32 + CostPerItem int32 + CurrencyID int32 + CurrencyIsBlueprint bool + ItemCondition float32 + ItemConditionMax float32 + ItemID int32 + ItemIsBlueprint bool + PriceMultiplier float32 + Quantity int32 + ReceivedQuantityMultiplier float32 + type ServerError struct + Code string + func (e *ServerError) Error() string + func (e *ServerError) Is(target error) bool + type ServerInfo struct + CamerasEnabled bool + HeaderImage string + LogoImage string + Map string + MapSize uint32 + MaxPlayers uint32 + Name string + Nexus string + NexusID int32 + NexusZone string + Players uint32 + QueuedPlayers uint32 + Salt uint32 + Seed uint32 + URL string + WipeTime time.Time + type StorageContents struct + Capacity int32 + HasProtection bool + Items []Item + ProtectionExpiry time.Time + type StorageMonitor struct + func (m StorageMonitor) Contents(ctx context.Context) (StorageContents, error) + func (m StorageMonitor) OnChanged(fn func(StorageContents)) (remove func()) + type Switch struct + func (s Switch) Off(ctx context.Context) error + func (s Switch) On(ctx context.Context) error + func (s Switch) OnChanged(fn func(on bool)) (remove func()) + func (s Switch) Set(ctx context.Context, on bool) error + func (s Switch) State(ctx context.Context) (on bool, err error) + type Team struct + func (t Team) Chat(ctx context.Context) ([]TeamMessage, error) + func (t Team) Info(ctx context.Context) (TeamInfo, error) + func (t Team) Kick(ctx context.Context, steamID uint64) error + func (t Team) OnChanged(fn func(TeamChanged)) (remove func()) + func (t Team) OnMessage(fn func(TeamMessage)) (remove func()) + func (t Team) Promote(ctx context.Context, steamID uint64) error + func (t Team) Send(ctx context.Context, message string) error + type TeamChanged struct + PlayerID uint64 + Team TeamInfo + type TeamInfo struct + LeaderMapNotes []MapNote + LeaderSteamID uint64 + MapNotes []MapNote + Members []TeamMember + func (t TeamInfo) Member(steamID uint64) (TeamMember, bool) + type TeamMember struct + Alive bool + DeathTime time.Time + Name string + Online bool + SpawnTime time.Time + SteamID uint64 + X float32 + Y float32 + type TeamMessage struct + Color string + Message string + Name string + SteamID uint64 + Time time.Time + type Vector4 struct + W float32 + X float32 + Y float32 + Z float32