http

package
v0.0.0-...-dbfe939 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const BASE_URL = "https://texttunnel-gyjkwvpeba-uc.a.run.app"

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpClient

type HttpClient struct {
	Client    *http.Client
	AuthToken string
}

func CreateHttpClient

func CreateHttpClient(token string) *HttpClient

func (*HttpClient) ConnectToSocket

func (c *HttpClient) ConnectToSocket(id uuid.UUID) (*websocket.Conn, context.Context, context.CancelFunc, error)

func (*HttpClient) CreateRoom

func (c *HttpClient) CreateRoom(name string) (models.Room, error)

func (*HttpClient) Do

func (c *HttpClient) Do(req *http.Request) (*http.Response, error)

func (*HttpClient) FetchRooms

func (c *HttpClient) FetchRooms() ([]models.Room, error)

func (*HttpClient) Get

func (c *HttpClient) Get(url string) (*http.Response, error)

func (*HttpClient) GetUserByAuthToken

func (c *HttpClient) GetUserByAuthToken() (models.User, error)

func (*HttpClient) Login

func (c *HttpClient) Login(username, password string) (models.User, error)

func (*HttpClient) Post

func (c *HttpClient) Post(url string, body io.Reader) (*http.Response, error)

func (*HttpClient) PostSignUp

func (c *HttpClient) PostSignUp(username, password string) (models.User, error)

func (*HttpClient) SetAuthToken

func (c *HttpClient) SetAuthToken(token string)

Jump to

Keyboard shortcuts

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