Skip to content

hdmi1519/plugify_http_client

Repository files navigation

HTTP Client Plugin for CS2 (Plugify)

Requirements

  • Go (1.20+)
  • Docker (for building)
  • Task (Taskfile runner)

Build Instructions

This project uses Task for automation. To build the plugin, run:

1. task gen
2. task build

Configuration

Located in configs/config.toml:

[client_params]
base_url = "https://api.your-server.com"
timeout = 5 

Install to server

1. Download latest release
2. Move the addons folder to the server
3. Edit config

How Usage

To use the http_client in your own plugins, ensure it is added as a dependency in your your_plugin.pplugin file:

"dependencies": [
    {
        "name": "http_client"
    }
]
import (
	"module_name/pkg/bindings/http_client"
	"fmt"
)

func (p *Plugin) SomeMethod() error {
	http_client.Get("https://jsonplaceholder.typicode.com/posts/1", func(resp string) {
		fmt.Printf("Response from JSON Placeholder: %s\n", resp)
	})

	return nil
}

About

HTTP client plugin

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors