contract

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 10, 2025 License: MIT Imports: 2 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseResponse

type BaseResponse struct {
	Code    int64  `json:"code,omitempty"`
	Success bool   `json:"success,omitempty"`
	Msg     string `json:"msg,omitempty"`
}

type HTTPConfig

type HTTPConfig struct {
	BaseUri  string `json:"baseUri,omitempty"`
	ProxyUri string `json:"proxyUri,omitempty"`
}

type PluginConfig

type PluginConfig struct {
	HTTPConfig
	AppId     string `json:"appId,omitempty"`
	AppSecret string `json:"appSecret,omitempty"`
	LogConfig config.LogConfig
}

type ProviderInterface

type ProviderInterface interface {
	// Initialize 插件初始化方法
	Initialize(ctx *context.Context, config interface{}) error
	// Name 返回插件名称
	Name(ctx *context.Context) string
	// Publish 发布内容的方法
	Publish(ctx *context.Context, req interface{}) (interface{}, error)
}

--------------------------------------------- Provider 定义插件需要实现的接口 ---------------------------------------------

type PublishRequest

type PublishRequest struct {
	Title   string `json:"title,omitempty"`
	Content string `json:"content,omitempty"`
}

type PublishResponse

type PublishResponse struct {
	BaseResponse
}

Jump to

Keyboard shortcuts

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