pustynia

package module
v0.0.0-...-26449e2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 17 Imported by: 0

README

Pustynia 💬

Introduction

This project is a very simple chat service with minimalistic end-to-end encryption. The server's job is to manage the rooms and broadcast all of the encrypted noise to the appropriate clients. To join a room, a random 9 letter code such as efz-fzg-tym and a password are required. Users can see other messages and type a new one with a label like bob> .

Missing features

Due to lack of time this project lacks very important features, such as:

  • Logging
  • Chat history
  • Permissions
  • Rate limiting

Contributing

If you would like to contribute to the project, feel free to fork the repository and submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Documentation

Index

Constants

View Source
const CodeSize = 11

Variables

View Source
var ErrInvalidPassword = errors.New("invalid password")

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(cfg *ClientConfig) (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) Run

func (c *Client) Run() error

type ClientConfig

type ClientConfig struct {
	RoomID    Code
	Username  string
	Password  []byte
	Addr      string
	TLSConfig *tls.Config
}

type Code

type Code [CodeSize]byte

func NewCode

func NewCode() (Code, error)

func ParseCode

func ParseCode(s string) (Code, bool)

func (Code) Bytes

func (c Code) Bytes() []byte

func (Code) String

func (c Code) String() string

type Server

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

func NewServer

func NewServer(cfg *ServerConfig) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) Run

func (s *Server) Run() error

type ServerConfig

type ServerConfig struct {
	Addr      string
	TLSConfig *tls.Config
	ErrorLog  *log.Logger
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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