httptransport

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Токен для доступа к ядру без контекста запроса
	CoreToken string `json:"core_token" yaml:"core_token"`

	// Базовый URL ядра (без путей),
	// например "https://admin.someprovider.net/"
	CoreURL string `json:"core_url" yaml:"core_url"`

	// Токен для авторизации запросов от ядра
	Token string `json:"token" yaml:"token"`
}

Конфигурация HTTP транспорта плагина

type Options

type Options struct {
	// http.Client для запросов к ядру.
	// Если nil, используется клиент по умолчанию с таймаутом запросов 30 секунд.
	Client *http.Client
}

Опции для http транспорта

type Transport

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

HTTP транспорт

func New

func New(config Config, options Options) (*Transport, error)

New создает экземпляр HTTP транспорта с заданной конфигурацией

func (*Transport) NewHandler

func (t *Transport) NewHandler(p *plugin.Plugin) http.Handler

NewHandler возвращает http.Handler для плагина

func (*Transport) PluginCoreClient

func (t *Transport) PluginCoreClient() plugin.CoreClient

PluginCoreClient возвращает клиент для вызовов API ядра от имени плагина

Source Files

  • coreapi.go
  • httptransport.go

Jump to

Keyboard shortcuts

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