proto

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginService_GetInfo_FullMethodName       = "/airgate.plugin.v1.PluginService/GetInfo"
	PluginService_Init_FullMethodName          = "/airgate.plugin.v1.PluginService/Init"
	PluginService_Start_FullMethodName         = "/airgate.plugin.v1.PluginService/Start"
	PluginService_Stop_FullMethodName          = "/airgate.plugin.v1.PluginService/Stop"
	PluginService_GetWebAssets_FullMethodName  = "/airgate.plugin.v1.PluginService/GetWebAssets"
	PluginService_HealthCheck_FullMethodName   = "/airgate.plugin.v1.PluginService/HealthCheck"
	PluginService_HandleRequest_FullMethodName = "/airgate.plugin.v1.PluginService/HandleRequest"
)
View Source
const (
	GatewayService_GetPlatform_FullMethodName     = "/airgate.plugin.v1.GatewayService/GetPlatform"
	GatewayService_GetModels_FullMethodName       = "/airgate.plugin.v1.GatewayService/GetModels"
	GatewayService_GetRoutes_FullMethodName       = "/airgate.plugin.v1.GatewayService/GetRoutes"
	GatewayService_Forward_FullMethodName         = "/airgate.plugin.v1.GatewayService/Forward"
	GatewayService_ForwardStream_FullMethodName   = "/airgate.plugin.v1.GatewayService/ForwardStream"
	GatewayService_ValidateAccount_FullMethodName = "/airgate.plugin.v1.GatewayService/ValidateAccount"
	GatewayService_QueryQuota_FullMethodName      = "/airgate.plugin.v1.GatewayService/QueryQuota"
	GatewayService_HandleWebSocket_FullMethodName = "/airgate.plugin.v1.GatewayService/HandleWebSocket"
)
View Source
const (
	ExtensionService_Migrate_FullMethodName             = "/airgate.plugin.v1.ExtensionService/Migrate"
	ExtensionService_GetBackgroundTasks_FullMethodName  = "/airgate.plugin.v1.ExtensionService/GetBackgroundTasks"
	ExtensionService_RunBackgroundTask_FullMethodName   = "/airgate.plugin.v1.ExtensionService/RunBackgroundTask"
	ExtensionService_HandleRequest_FullMethodName       = "/airgate.plugin.v1.ExtensionService/HandleRequest"
	ExtensionService_HandleStreamRequest_FullMethodName = "/airgate.plugin.v1.ExtensionService/HandleStreamRequest"
)
View Source
const (
	MiddlewareService_OnForwardBegin_FullMethodName = "/airgate.plugin.v1.MiddlewareService/OnForwardBegin"
	MiddlewareService_OnForwardEnd_FullMethodName   = "/airgate.plugin.v1.MiddlewareService/OnForwardEnd"
)
View Source
const (
	HostService_SelectAccount_FullMethodName       = "/airgate.plugin.v1.HostService/SelectAccount"
	HostService_ReportAccountResult_FullMethodName = "/airgate.plugin.v1.HostService/ReportAccountResult"
	HostService_ProbeForward_FullMethodName        = "/airgate.plugin.v1.HostService/ProbeForward"
	HostService_Forward_FullMethodName             = "/airgate.plugin.v1.HostService/Forward"
	HostService_ForwardStream_FullMethodName       = "/airgate.plugin.v1.HostService/ForwardStream"
	HostService_ListGroups_FullMethodName          = "/airgate.plugin.v1.HostService/ListGroups"
	HostService_ListPlatforms_FullMethodName       = "/airgate.plugin.v1.HostService/ListPlatforms"
	HostService_ListModels_FullMethodName          = "/airgate.plugin.v1.HostService/ListModels"
	HostService_GetUserInfo_FullMethodName         = "/airgate.plugin.v1.HostService/GetUserInfo"
	HostService_StoreAsset_FullMethodName          = "/airgate.plugin.v1.HostService/StoreAsset"
	HostService_GetAssetURL_FullMethodName         = "/airgate.plugin.v1.HostService/GetAssetURL"
	HostService_GetAssetBytes_FullMethodName       = "/airgate.plugin.v1.HostService/GetAssetBytes"
)

Variables

View Source
var (
	OutcomeKind_name = map[int32]string{
		0: "OUTCOME_UNKNOWN",
		1: "OUTCOME_SUCCESS",
		2: "OUTCOME_CLIENT_ERROR",
		3: "OUTCOME_ACCOUNT_RATE_LIMITED",
		4: "OUTCOME_ACCOUNT_DEAD",
		5: "OUTCOME_UPSTREAM_TRANSIENT",
		6: "OUTCOME_STREAM_ABORTED",
	}
	OutcomeKind_value = map[string]int32{
		"OUTCOME_UNKNOWN":              0,
		"OUTCOME_SUCCESS":              1,
		"OUTCOME_CLIENT_ERROR":         2,
		"OUTCOME_ACCOUNT_RATE_LIMITED": 3,
		"OUTCOME_ACCOUNT_DEAD":         4,
		"OUTCOME_UPSTREAM_TRANSIENT":   5,
		"OUTCOME_STREAM_ABORTED":       6,
	}
)

Enum value maps for OutcomeKind.

View Source
var (
	WebSocketFrame_FrameType_name = map[int32]string{
		0: "CONNECT",
		1: "TEXT",
		2: "BINARY",
		3: "CLOSE",
		4: "RESULT",
	}
	WebSocketFrame_FrameType_value = map[string]int32{
		"CONNECT": 0,
		"TEXT":    1,
		"BINARY":  2,
		"CLOSE":   3,
		"RESULT":  4,
	}
)

Enum value maps for WebSocketFrame_FrameType.

View Source
var (
	MiddlewareDecision_Action_name = map[int32]string{
		0: "ALLOW",
		1: "DENY",
		2: "MUTATE",
	}
	MiddlewareDecision_Action_value = map[string]int32{
		"ALLOW":  0,
		"DENY":   1,
		"MUTATE": 2,
	}
)

Enum value maps for MiddlewareDecision_Action.

View Source
var ExtensionService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "airgate.plugin.v1.ExtensionService",
	HandlerType: (*ExtensionServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Migrate",
			Handler:    _ExtensionService_Migrate_Handler,
		},
		{
			MethodName: "GetBackgroundTasks",
			Handler:    _ExtensionService_GetBackgroundTasks_Handler,
		},
		{
			MethodName: "RunBackgroundTask",
			Handler:    _ExtensionService_RunBackgroundTask_Handler,
		},
		{
			MethodName: "HandleRequest",
			Handler:    _ExtensionService_HandleRequest_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "HandleStreamRequest",
			Handler:       _ExtensionService_HandleStreamRequest_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "plugin.proto",
}

ExtensionService_ServiceDesc is the grpc.ServiceDesc for ExtensionService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_plugin_proto protoreflect.FileDescriptor
View Source
var GatewayService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "airgate.plugin.v1.GatewayService",
	HandlerType: (*GatewayServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetPlatform",
			Handler:    _GatewayService_GetPlatform_Handler,
		},
		{
			MethodName: "GetModels",
			Handler:    _GatewayService_GetModels_Handler,
		},
		{
			MethodName: "GetRoutes",
			Handler:    _GatewayService_GetRoutes_Handler,
		},
		{
			MethodName: "Forward",
			Handler:    _GatewayService_Forward_Handler,
		},
		{
			MethodName: "ValidateAccount",
			Handler:    _GatewayService_ValidateAccount_Handler,
		},
		{
			MethodName: "QueryQuota",
			Handler:    _GatewayService_QueryQuota_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ForwardStream",
			Handler:       _GatewayService_ForwardStream_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "HandleWebSocket",
			Handler:       _GatewayService_HandleWebSocket_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "plugin.proto",
}

GatewayService_ServiceDesc is the grpc.ServiceDesc for GatewayService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var HostService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "airgate.plugin.v1.HostService",
	HandlerType: (*HostServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SelectAccount",
			Handler:    _HostService_SelectAccount_Handler,
		},
		{
			MethodName: "ReportAccountResult",
			Handler:    _HostService_ReportAccountResult_Handler,
		},
		{
			MethodName: "ProbeForward",
			Handler:    _HostService_ProbeForward_Handler,
		},
		{
			MethodName: "Forward",
			Handler:    _HostService_Forward_Handler,
		},
		{
			MethodName: "ListGroups",
			Handler:    _HostService_ListGroups_Handler,
		},
		{
			MethodName: "ListPlatforms",
			Handler:    _HostService_ListPlatforms_Handler,
		},
		{
			MethodName: "ListModels",
			Handler:    _HostService_ListModels_Handler,
		},
		{
			MethodName: "GetUserInfo",
			Handler:    _HostService_GetUserInfo_Handler,
		},
		{
			MethodName: "StoreAsset",
			Handler:    _HostService_StoreAsset_Handler,
		},
		{
			MethodName: "GetAssetURL",
			Handler:    _HostService_GetAssetURL_Handler,
		},
		{
			MethodName: "GetAssetBytes",
			Handler:    _HostService_GetAssetBytes_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ForwardStream",
			Handler:       _HostService_ForwardStream_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "plugin.proto",
}

HostService_ServiceDesc is the grpc.ServiceDesc for HostService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var MiddlewareService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "airgate.plugin.v1.MiddlewareService",
	HandlerType: (*MiddlewareServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "OnForwardBegin",
			Handler:    _MiddlewareService_OnForwardBegin_Handler,
		},
		{
			MethodName: "OnForwardEnd",
			Handler:    _MiddlewareService_OnForwardEnd_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "plugin.proto",
}

MiddlewareService_ServiceDesc is the grpc.ServiceDesc for MiddlewareService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var PluginService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "airgate.plugin.v1.PluginService",
	HandlerType: (*PluginServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetInfo",
			Handler:    _PluginService_GetInfo_Handler,
		},
		{
			MethodName: "Init",
			Handler:    _PluginService_Init_Handler,
		},
		{
			MethodName: "Start",
			Handler:    _PluginService_Start_Handler,
		},
		{
			MethodName: "Stop",
			Handler:    _PluginService_Stop_Handler,
		},
		{
			MethodName: "GetWebAssets",
			Handler:    _PluginService_GetWebAssets_Handler,
		},
		{
			MethodName: "HealthCheck",
			Handler:    _PluginService_HealthCheck_Handler,
		},
		{
			MethodName: "HandleRequest",
			Handler:    _PluginService_HandleRequest_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "plugin.proto",
}

PluginService_ServiceDesc is the grpc.ServiceDesc for PluginService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterExtensionServiceServer

func RegisterExtensionServiceServer(s grpc.ServiceRegistrar, srv ExtensionServiceServer)

func RegisterGatewayServiceServer

func RegisterGatewayServiceServer(s grpc.ServiceRegistrar, srv GatewayServiceServer)

func RegisterHostServiceServer

func RegisterHostServiceServer(s grpc.ServiceRegistrar, srv HostServiceServer)

func RegisterMiddlewareServiceServer

func RegisterMiddlewareServiceServer(s grpc.ServiceRegistrar, srv MiddlewareServiceServer)

func RegisterPluginServiceServer

func RegisterPluginServiceServer(s grpc.ServiceRegistrar, srv PluginServiceServer)

Types

type AccountProto

type AccountProto struct {
	Id              int64  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Name            string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Platform        string `protobuf:"bytes,3,opt,name=platform,proto3" json:"platform,omitempty"`
	Type            string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"`
	CredentialsJson []byte `protobuf:"bytes,5,opt,name=credentials_json,json=credentialsJson,proto3" json:"credentials_json,omitempty"`
	ProxyUrl        string `protobuf:"bytes,6,opt,name=proxy_url,json=proxyUrl,proto3" json:"proxy_url,omitempty"`
	// contains filtered or unexported fields
}

func (*AccountProto) Descriptor deprecated

func (*AccountProto) Descriptor() ([]byte, []int)

Deprecated: Use AccountProto.ProtoReflect.Descriptor instead.

func (*AccountProto) GetCredentialsJson

func (x *AccountProto) GetCredentialsJson() []byte

func (*AccountProto) GetId

func (x *AccountProto) GetId() int64

func (*AccountProto) GetName

func (x *AccountProto) GetName() string

func (*AccountProto) GetPlatform

func (x *AccountProto) GetPlatform() string

func (*AccountProto) GetProxyUrl

func (x *AccountProto) GetProxyUrl() string

func (*AccountProto) GetType

func (x *AccountProto) GetType() string

func (*AccountProto) ProtoMessage

func (*AccountProto) ProtoMessage()

func (*AccountProto) ProtoReflect

func (x *AccountProto) ProtoReflect() protoreflect.Message

func (*AccountProto) Reset

func (x *AccountProto) Reset()

func (*AccountProto) String

func (x *AccountProto) String() string

type AccountTypeProto

type AccountTypeProto struct {
	Key         string                  `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Label       string                  `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"`
	Description string                  `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	Fields      []*CredentialFieldProto `protobuf:"bytes,4,rep,name=fields,proto3" json:"fields,omitempty"`
	// contains filtered or unexported fields
}

func (*AccountTypeProto) Descriptor deprecated

func (*AccountTypeProto) Descriptor() ([]byte, []int)

Deprecated: Use AccountTypeProto.ProtoReflect.Descriptor instead.

func (*AccountTypeProto) GetDescription

func (x *AccountTypeProto) GetDescription() string

func (*AccountTypeProto) GetFields

func (x *AccountTypeProto) GetFields() []*CredentialFieldProto

func (*AccountTypeProto) GetKey

func (x *AccountTypeProto) GetKey() string

func (*AccountTypeProto) GetLabel

func (x *AccountTypeProto) GetLabel() string

func (*AccountTypeProto) ProtoMessage

func (*AccountTypeProto) ProtoMessage()

func (*AccountTypeProto) ProtoReflect

func (x *AccountTypeProto) ProtoReflect() protoreflect.Message

func (*AccountTypeProto) Reset

func (x *AccountTypeProto) Reset()

func (*AccountTypeProto) String

func (x *AccountTypeProto) String() string

type BackgroundTaskProto

type BackgroundTaskProto struct {
	Name       string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	IntervalMs int64  `protobuf:"varint,2,opt,name=interval_ms,json=intervalMs,proto3" json:"interval_ms,omitempty"`
	// contains filtered or unexported fields
}

func (*BackgroundTaskProto) Descriptor deprecated

func (*BackgroundTaskProto) Descriptor() ([]byte, []int)

Deprecated: Use BackgroundTaskProto.ProtoReflect.Descriptor instead.

func (*BackgroundTaskProto) GetIntervalMs

func (x *BackgroundTaskProto) GetIntervalMs() int64

func (*BackgroundTaskProto) GetName

func (x *BackgroundTaskProto) GetName() string

func (*BackgroundTaskProto) ProtoMessage

func (*BackgroundTaskProto) ProtoMessage()

func (*BackgroundTaskProto) ProtoReflect

func (x *BackgroundTaskProto) ProtoReflect() protoreflect.Message

func (*BackgroundTaskProto) Reset

func (x *BackgroundTaskProto) Reset()

func (*BackgroundTaskProto) String

func (x *BackgroundTaskProto) String() string

type BackgroundTasksResponse

type BackgroundTasksResponse struct {
	Tasks []*BackgroundTaskProto `protobuf:"bytes,1,rep,name=tasks,proto3" json:"tasks,omitempty"`
	// contains filtered or unexported fields
}

func (*BackgroundTasksResponse) Descriptor deprecated

func (*BackgroundTasksResponse) Descriptor() ([]byte, []int)

Deprecated: Use BackgroundTasksResponse.ProtoReflect.Descriptor instead.

func (*BackgroundTasksResponse) GetTasks

func (*BackgroundTasksResponse) ProtoMessage

func (*BackgroundTasksResponse) ProtoMessage()

func (*BackgroundTasksResponse) ProtoReflect

func (x *BackgroundTasksResponse) ProtoReflect() protoreflect.Message

func (*BackgroundTasksResponse) Reset

func (x *BackgroundTasksResponse) Reset()

func (*BackgroundTasksResponse) String

func (x *BackgroundTasksResponse) String() string

type ConfigFieldProto

type ConfigFieldProto struct {
	Key          string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Label        string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"`
	Type         string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
	Required     bool   `protobuf:"varint,4,opt,name=required,proto3" json:"required,omitempty"`
	DefaultValue string `protobuf:"bytes,5,opt,name=default_value,json=defaultValue,proto3" json:"default_value,omitempty"`
	Description  string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"`
	Placeholder  string `protobuf:"bytes,7,opt,name=placeholder,proto3" json:"placeholder,omitempty"`
	// contains filtered or unexported fields
}

func (*ConfigFieldProto) Descriptor deprecated

func (*ConfigFieldProto) Descriptor() ([]byte, []int)

Deprecated: Use ConfigFieldProto.ProtoReflect.Descriptor instead.

func (*ConfigFieldProto) GetDefaultValue

func (x *ConfigFieldProto) GetDefaultValue() string

func (*ConfigFieldProto) GetDescription

func (x *ConfigFieldProto) GetDescription() string

func (*ConfigFieldProto) GetKey

func (x *ConfigFieldProto) GetKey() string

func (*ConfigFieldProto) GetLabel

func (x *ConfigFieldProto) GetLabel() string

func (*ConfigFieldProto) GetPlaceholder

func (x *ConfigFieldProto) GetPlaceholder() string

func (*ConfigFieldProto) GetRequired

func (x *ConfigFieldProto) GetRequired() bool

func (*ConfigFieldProto) GetType

func (x *ConfigFieldProto) GetType() string

func (*ConfigFieldProto) ProtoMessage

func (*ConfigFieldProto) ProtoMessage()

func (*ConfigFieldProto) ProtoReflect

func (x *ConfigFieldProto) ProtoReflect() protoreflect.Message

func (*ConfigFieldProto) Reset

func (x *ConfigFieldProto) Reset()

func (*ConfigFieldProto) String

func (x *ConfigFieldProto) String() string

type CredentialFieldProto

type CredentialFieldProto struct {
	Key          string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Label        string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"`
	Type         string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
	Required     bool   `protobuf:"varint,4,opt,name=required,proto3" json:"required,omitempty"`
	Placeholder  string `protobuf:"bytes,5,opt,name=placeholder,proto3" json:"placeholder,omitempty"`
	EditDisabled bool   `protobuf:"varint,6,opt,name=edit_disabled,json=editDisabled,proto3" json:"edit_disabled,omitempty"` // 编辑模式下隐藏该字段
	// contains filtered or unexported fields
}

func (*CredentialFieldProto) Descriptor deprecated

func (*CredentialFieldProto) Descriptor() ([]byte, []int)

Deprecated: Use CredentialFieldProto.ProtoReflect.Descriptor instead.

func (*CredentialFieldProto) GetEditDisabled

func (x *CredentialFieldProto) GetEditDisabled() bool

func (*CredentialFieldProto) GetKey

func (x *CredentialFieldProto) GetKey() string

func (*CredentialFieldProto) GetLabel

func (x *CredentialFieldProto) GetLabel() string

func (*CredentialFieldProto) GetPlaceholder

func (x *CredentialFieldProto) GetPlaceholder() string

func (*CredentialFieldProto) GetRequired

func (x *CredentialFieldProto) GetRequired() bool

func (*CredentialFieldProto) GetType

func (x *CredentialFieldProto) GetType() string

func (*CredentialFieldProto) ProtoMessage

func (*CredentialFieldProto) ProtoMessage()

func (*CredentialFieldProto) ProtoReflect

func (x *CredentialFieldProto) ProtoReflect() protoreflect.Message

func (*CredentialFieldProto) Reset

func (x *CredentialFieldProto) Reset()

func (*CredentialFieldProto) String

func (x *CredentialFieldProto) String() string

type CredentialsRequest

type CredentialsRequest struct {
	Credentials map[string]string `` /* 149-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*CredentialsRequest) Descriptor deprecated

func (*CredentialsRequest) Descriptor() ([]byte, []int)

Deprecated: Use CredentialsRequest.ProtoReflect.Descriptor instead.

func (*CredentialsRequest) GetCredentials

func (x *CredentialsRequest) GetCredentials() map[string]string

func (*CredentialsRequest) ProtoMessage

func (*CredentialsRequest) ProtoMessage()

func (*CredentialsRequest) ProtoReflect

func (x *CredentialsRequest) ProtoReflect() protoreflect.Message

func (*CredentialsRequest) Reset

func (x *CredentialsRequest) Reset()

func (*CredentialsRequest) String

func (x *CredentialsRequest) String() string

type Empty

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

func (*Empty) Descriptor deprecated

func (*Empty) Descriptor() ([]byte, []int)

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

func (x *Empty) ProtoReflect() protoreflect.Message

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type ExtensionServiceClient

type ExtensionServiceClient interface {
	Migrate(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
	GetBackgroundTasks(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*BackgroundTasksResponse, error)
	// 由 Core 调度器按 Interval 周期触发;插件进程内查表执行 Handler
	RunBackgroundTask(ctx context.Context, in *RunBackgroundTaskRequest, opts ...grpc.CallOption) (*Empty, error)
	// HTTP 请求由核心代理到插件
	HandleRequest(ctx context.Context, in *HttpRequest, opts ...grpc.CallOption) (*HttpResponse, error)
	HandleStreamRequest(ctx context.Context, in *HttpRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[HttpResponseChunk], error)
}

ExtensionServiceClient is the client API for ExtensionService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type ExtensionServiceServer

type ExtensionServiceServer interface {
	Migrate(context.Context, *Empty) (*Empty, error)
	GetBackgroundTasks(context.Context, *Empty) (*BackgroundTasksResponse, error)
	// 由 Core 调度器按 Interval 周期触发;插件进程内查表执行 Handler
	RunBackgroundTask(context.Context, *RunBackgroundTaskRequest) (*Empty, error)
	// HTTP 请求由核心代理到插件
	HandleRequest(context.Context, *HttpRequest) (*HttpResponse, error)
	HandleStreamRequest(*HttpRequest, grpc.ServerStreamingServer[HttpResponseChunk]) error
	// contains filtered or unexported methods
}

ExtensionServiceServer is the server API for ExtensionService service. All implementations must embed UnimplementedExtensionServiceServer for forward compatibility.

type ExtensionService_HandleStreamRequestClient

type ExtensionService_HandleStreamRequestClient = grpc.ServerStreamingClient[HttpResponseChunk]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type ExtensionService_HandleStreamRequestServer

type ExtensionService_HandleStreamRequestServer = grpc.ServerStreamingServer[HttpResponseChunk]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type ForwardChunk

type ForwardChunk struct {
	Data         []byte                   `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	Done         bool                     `protobuf:"varint,2,opt,name=done,proto3" json:"done,omitempty"`
	FinalOutcome *ForwardOutcome          `protobuf:"bytes,3,opt,name=final_outcome,json=finalOutcome,proto3" json:"final_outcome,omitempty"`
	StatusCode   int32                    `protobuf:"varint,4,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
	Headers      map[string]*HeaderValues `` /* 141-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ForwardChunk) Descriptor deprecated

func (*ForwardChunk) Descriptor() ([]byte, []int)

Deprecated: Use ForwardChunk.ProtoReflect.Descriptor instead.

func (*ForwardChunk) GetData

func (x *ForwardChunk) GetData() []byte

func (*ForwardChunk) GetDone

func (x *ForwardChunk) GetDone() bool

func (*ForwardChunk) GetFinalOutcome

func (x *ForwardChunk) GetFinalOutcome() *ForwardOutcome

func (*ForwardChunk) GetHeaders

func (x *ForwardChunk) GetHeaders() map[string]*HeaderValues

func (*ForwardChunk) GetStatusCode

func (x *ForwardChunk) GetStatusCode() int32

func (*ForwardChunk) ProtoMessage

func (*ForwardChunk) ProtoMessage()

func (*ForwardChunk) ProtoReflect

func (x *ForwardChunk) ProtoReflect() protoreflect.Message

func (*ForwardChunk) Reset

func (x *ForwardChunk) Reset()

func (*ForwardChunk) String

func (x *ForwardChunk) String() string

type ForwardOutcome

type ForwardOutcome struct {
	Kind               OutcomeKind       `protobuf:"varint,1,opt,name=kind,proto3,enum=airgate.plugin.v1.OutcomeKind" json:"kind,omitempty"`
	Upstream           *UpstreamResponse `protobuf:"bytes,2,opt,name=upstream,proto3" json:"upstream,omitempty"`
	Usage              *Usage            `protobuf:"bytes,3,opt,name=usage,proto3" json:"usage,omitempty"`
	DurationMs         int64             `protobuf:"varint,4,opt,name=duration_ms,json=durationMs,proto3" json:"duration_ms,omitempty"`
	RetryAfterMs       int64             `protobuf:"varint,5,opt,name=retry_after_ms,json=retryAfterMs,proto3" json:"retry_after_ms,omitempty"`
	Reason             string            `protobuf:"bytes,6,opt,name=reason,proto3" json:"reason,omitempty"`
	UpdatedCredentials map[string]string `` /* 189-byte string literal not displayed */
	// contains filtered or unexported fields
}

ForwardOutcome 插件对一次 Forward 的完整判决结果。

func (*ForwardOutcome) Descriptor deprecated

func (*ForwardOutcome) Descriptor() ([]byte, []int)

Deprecated: Use ForwardOutcome.ProtoReflect.Descriptor instead.

func (*ForwardOutcome) GetDurationMs

func (x *ForwardOutcome) GetDurationMs() int64

func (*ForwardOutcome) GetKind

func (x *ForwardOutcome) GetKind() OutcomeKind

func (*ForwardOutcome) GetReason

func (x *ForwardOutcome) GetReason() string

func (*ForwardOutcome) GetRetryAfterMs

func (x *ForwardOutcome) GetRetryAfterMs() int64

func (*ForwardOutcome) GetUpdatedCredentials

func (x *ForwardOutcome) GetUpdatedCredentials() map[string]string

func (*ForwardOutcome) GetUpstream

func (x *ForwardOutcome) GetUpstream() *UpstreamResponse

func (*ForwardOutcome) GetUsage

func (x *ForwardOutcome) GetUsage() *Usage

func (*ForwardOutcome) ProtoMessage

func (*ForwardOutcome) ProtoMessage()

func (*ForwardOutcome) ProtoReflect

func (x *ForwardOutcome) ProtoReflect() protoreflect.Message

func (*ForwardOutcome) Reset

func (x *ForwardOutcome) Reset()

func (*ForwardOutcome) String

func (x *ForwardOutcome) String() string

type ForwardRequest

type ForwardRequest struct {
	Body    []byte                   `protobuf:"bytes,7,opt,name=body,proto3" json:"body,omitempty"`
	Headers map[string]*HeaderValues `` /* 141-byte string literal not displayed */
	Model   string                   `protobuf:"bytes,9,opt,name=model,proto3" json:"model,omitempty"`
	Stream  bool                     `protobuf:"varint,10,opt,name=stream,proto3" json:"stream,omitempty"`
	Account *AccountProto            `protobuf:"bytes,11,opt,name=account,proto3" json:"account,omitempty"`
	// contains filtered or unexported fields
}

func (*ForwardRequest) Descriptor deprecated

func (*ForwardRequest) Descriptor() ([]byte, []int)

Deprecated: Use ForwardRequest.ProtoReflect.Descriptor instead.

func (*ForwardRequest) GetAccount

func (x *ForwardRequest) GetAccount() *AccountProto

func (*ForwardRequest) GetBody

func (x *ForwardRequest) GetBody() []byte

func (*ForwardRequest) GetHeaders

func (x *ForwardRequest) GetHeaders() map[string]*HeaderValues

func (*ForwardRequest) GetModel

func (x *ForwardRequest) GetModel() string

func (*ForwardRequest) GetStream

func (x *ForwardRequest) GetStream() bool

func (*ForwardRequest) ProtoMessage

func (*ForwardRequest) ProtoMessage()

func (*ForwardRequest) ProtoReflect

func (x *ForwardRequest) ProtoReflect() protoreflect.Message

func (*ForwardRequest) Reset

func (x *ForwardRequest) Reset()

func (*ForwardRequest) String

func (x *ForwardRequest) String() string

type FrontendPageProto

type FrontendPageProto struct {
	Path        string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	Title       string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
	Icon        string `protobuf:"bytes,3,opt,name=icon,proto3" json:"icon,omitempty"`
	Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
	Audience    string `protobuf:"bytes,5,opt,name=audience,proto3" json:"audience,omitempty"` // "admin" | "user" | "all",空 = "admin"
	// contains filtered or unexported fields
}

func (*FrontendPageProto) Descriptor deprecated

func (*FrontendPageProto) Descriptor() ([]byte, []int)

Deprecated: Use FrontendPageProto.ProtoReflect.Descriptor instead.

func (*FrontendPageProto) GetAudience

func (x *FrontendPageProto) GetAudience() string

func (*FrontendPageProto) GetDescription

func (x *FrontendPageProto) GetDescription() string

func (*FrontendPageProto) GetIcon

func (x *FrontendPageProto) GetIcon() string

func (*FrontendPageProto) GetPath

func (x *FrontendPageProto) GetPath() string

func (*FrontendPageProto) GetTitle

func (x *FrontendPageProto) GetTitle() string

func (*FrontendPageProto) ProtoMessage

func (*FrontendPageProto) ProtoMessage()

func (*FrontendPageProto) ProtoReflect

func (x *FrontendPageProto) ProtoReflect() protoreflect.Message

func (*FrontendPageProto) Reset

func (x *FrontendPageProto) Reset()

func (*FrontendPageProto) String

func (x *FrontendPageProto) String() string

type FrontendWidgetProto

type FrontendWidgetProto struct {
	Slot      string `protobuf:"bytes,1,opt,name=slot,proto3" json:"slot,omitempty"`
	EntryFile string `protobuf:"bytes,2,opt,name=entry_file,json=entryFile,proto3" json:"entry_file,omitempty"`
	Title     string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
	// contains filtered or unexported fields
}

func (*FrontendWidgetProto) Descriptor deprecated

func (*FrontendWidgetProto) Descriptor() ([]byte, []int)

Deprecated: Use FrontendWidgetProto.ProtoReflect.Descriptor instead.

func (*FrontendWidgetProto) GetEntryFile

func (x *FrontendWidgetProto) GetEntryFile() string

func (*FrontendWidgetProto) GetSlot

func (x *FrontendWidgetProto) GetSlot() string

func (*FrontendWidgetProto) GetTitle

func (x *FrontendWidgetProto) GetTitle() string

func (*FrontendWidgetProto) ProtoMessage

func (*FrontendWidgetProto) ProtoMessage()

func (*FrontendWidgetProto) ProtoReflect

func (x *FrontendWidgetProto) ProtoReflect() protoreflect.Message

func (*FrontendWidgetProto) Reset

func (x *FrontendWidgetProto) Reset()

func (*FrontendWidgetProto) String

func (x *FrontendWidgetProto) String() string

type GatewayServiceClient

type GatewayServiceClient interface {
	GetPlatform(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*StringResponse, error)
	GetModels(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ModelsResponse, error)
	GetRoutes(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*RoutesResponse, error)
	Forward(ctx context.Context, in *ForwardRequest, opts ...grpc.CallOption) (*ForwardOutcome, error)
	ForwardStream(ctx context.Context, in *ForwardRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ForwardChunk], error)
	ValidateAccount(ctx context.Context, in *CredentialsRequest, opts ...grpc.CallOption) (*Empty, error)
	QueryQuota(ctx context.Context, in *CredentialsRequest, opts ...grpc.CallOption) (*QuotaInfoResponse, error)
	// WebSocket 双向流
	HandleWebSocket(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[WebSocketFrame, WebSocketFrame], error)
}

GatewayServiceClient is the client API for GatewayService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type GatewayServiceServer

type GatewayServiceServer interface {
	GetPlatform(context.Context, *Empty) (*StringResponse, error)
	GetModels(context.Context, *Empty) (*ModelsResponse, error)
	GetRoutes(context.Context, *Empty) (*RoutesResponse, error)
	Forward(context.Context, *ForwardRequest) (*ForwardOutcome, error)
	ForwardStream(*ForwardRequest, grpc.ServerStreamingServer[ForwardChunk]) error
	ValidateAccount(context.Context, *CredentialsRequest) (*Empty, error)
	QueryQuota(context.Context, *CredentialsRequest) (*QuotaInfoResponse, error)
	// WebSocket 双向流
	HandleWebSocket(grpc.BidiStreamingServer[WebSocketFrame, WebSocketFrame]) error
	// contains filtered or unexported methods
}

GatewayServiceServer is the server API for GatewayService service. All implementations must embed UnimplementedGatewayServiceServer for forward compatibility.

type GatewayService_ForwardStreamClient

type GatewayService_ForwardStreamClient = grpc.ServerStreamingClient[ForwardChunk]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type GatewayService_ForwardStreamServer

type GatewayService_ForwardStreamServer = grpc.ServerStreamingServer[ForwardChunk]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type GatewayService_HandleWebSocketClient

type GatewayService_HandleWebSocketClient = grpc.BidiStreamingClient[WebSocketFrame, WebSocketFrame]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type GatewayService_HandleWebSocketServer

type GatewayService_HandleWebSocketServer = grpc.BidiStreamingServer[WebSocketFrame, WebSocketFrame]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type HeaderValues

type HeaderValues struct {
	Values []string `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
	// contains filtered or unexported fields
}

HeaderValues 支持同一 Header 有多个值(如 Set-Cookie)

func (*HeaderValues) Descriptor deprecated

func (*HeaderValues) Descriptor() ([]byte, []int)

Deprecated: Use HeaderValues.ProtoReflect.Descriptor instead.

func (*HeaderValues) GetValues

func (x *HeaderValues) GetValues() []string

func (*HeaderValues) ProtoMessage

func (*HeaderValues) ProtoMessage()

func (*HeaderValues) ProtoReflect

func (x *HeaderValues) ProtoReflect() protoreflect.Message

func (*HeaderValues) Reset

func (x *HeaderValues) Reset()

func (*HeaderValues) String

func (x *HeaderValues) String() string

type HostForwardChunk added in v0.1.1

type HostForwardChunk struct {
	Data       []byte                   `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	Done       bool                     `protobuf:"varint,2,opt,name=done,proto3" json:"done,omitempty"`
	StatusCode int32                    `protobuf:"varint,3,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` // 仅首块
	Headers    map[string]*HeaderValues ``                                                                                             // 仅首块
	/* 141-byte string literal not displayed */
	Usage *HostForwardUsage `protobuf:"bytes,5,opt,name=usage,proto3" json:"usage,omitempty"` // 仅末块
	// contains filtered or unexported fields
}

HostForwardChunk 流式转发的单块数据。 第一块携带 status_code + headers;最后一块 done=true 携带 usage。

func (*HostForwardChunk) Descriptor deprecated added in v0.1.1

func (*HostForwardChunk) Descriptor() ([]byte, []int)

Deprecated: Use HostForwardChunk.ProtoReflect.Descriptor instead.

func (*HostForwardChunk) GetData added in v0.1.1

func (x *HostForwardChunk) GetData() []byte

func (*HostForwardChunk) GetDone added in v0.1.1

func (x *HostForwardChunk) GetDone() bool

func (*HostForwardChunk) GetHeaders added in v0.1.1

func (x *HostForwardChunk) GetHeaders() map[string]*HeaderValues

func (*HostForwardChunk) GetStatusCode added in v0.1.1

func (x *HostForwardChunk) GetStatusCode() int32

func (*HostForwardChunk) GetUsage added in v0.1.1

func (x *HostForwardChunk) GetUsage() *HostForwardUsage

func (*HostForwardChunk) ProtoMessage added in v0.1.1

func (*HostForwardChunk) ProtoMessage()

func (*HostForwardChunk) ProtoReflect added in v0.1.1

func (x *HostForwardChunk) ProtoReflect() protoreflect.Message

func (*HostForwardChunk) Reset added in v0.1.1

func (x *HostForwardChunk) Reset()

func (*HostForwardChunk) String added in v0.1.1

func (x *HostForwardChunk) String() string

type HostForwardRequest added in v0.1.1

type HostForwardRequest struct {
	UserId  int64                    `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`    // 计费主体(扣余额的用户)
	GroupId int64                    `protobuf:"varint,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"` // 调度分组
	Model   string                   `protobuf:"bytes,3,opt,name=model,proto3" json:"model,omitempty"`                     // 可空:空时 Core 取该 platform 的第一个 model
	Method  string                   `protobuf:"bytes,4,opt,name=method,proto3" json:"method,omitempty"`                   // HTTP method(POST / GET / ...)
	Path    string                   `protobuf:"bytes,5,opt,name=path,proto3" json:"path,omitempty"`                       // 请求路径(如 /v1/chat/completions)
	Headers map[string]*HeaderValues ``                                                                                    /* 141-byte string literal not displayed */
	Body    []byte                   `protobuf:"bytes,7,opt,name=body,proto3" json:"body,omitempty"`
	Stream  bool                     `protobuf:"varint,8,opt,name=stream,proto3" json:"stream,omitempty"` // 是否流式
	// contains filtered or unexported fields
}

HostForwardRequest 业务转发入参。 user_id + group_id 共同确定计费主体和调度路径。

func (*HostForwardRequest) Descriptor deprecated added in v0.1.1

func (*HostForwardRequest) Descriptor() ([]byte, []int)

Deprecated: Use HostForwardRequest.ProtoReflect.Descriptor instead.

func (*HostForwardRequest) GetBody added in v0.1.1

func (x *HostForwardRequest) GetBody() []byte

func (*HostForwardRequest) GetGroupId added in v0.1.1

func (x *HostForwardRequest) GetGroupId() int64

func (*HostForwardRequest) GetHeaders added in v0.1.1

func (x *HostForwardRequest) GetHeaders() map[string]*HeaderValues

func (*HostForwardRequest) GetMethod added in v0.1.1

func (x *HostForwardRequest) GetMethod() string

func (*HostForwardRequest) GetModel added in v0.1.1

func (x *HostForwardRequest) GetModel() string

func (*HostForwardRequest) GetPath added in v0.1.1

func (x *HostForwardRequest) GetPath() string

func (*HostForwardRequest) GetStream added in v0.1.1

func (x *HostForwardRequest) GetStream() bool

func (*HostForwardRequest) GetUserId added in v0.1.1

func (x *HostForwardRequest) GetUserId() int64

func (*HostForwardRequest) ProtoMessage added in v0.1.1

func (*HostForwardRequest) ProtoMessage()

func (*HostForwardRequest) ProtoReflect added in v0.1.1

func (x *HostForwardRequest) ProtoReflect() protoreflect.Message

func (*HostForwardRequest) Reset added in v0.1.1

func (x *HostForwardRequest) Reset()

func (*HostForwardRequest) String added in v0.1.1

func (x *HostForwardRequest) String() string

type HostForwardResponse added in v0.1.1

type HostForwardResponse struct {
	StatusCode int32                    `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
	Headers    map[string]*HeaderValues `` /* 141-byte string literal not displayed */
	Body       []byte                   `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
	Usage      *HostForwardUsage        `protobuf:"bytes,4,opt,name=usage,proto3" json:"usage,omitempty"`
	// contains filtered or unexported fields
}

HostForwardResponse 非流式转发结果。

func (*HostForwardResponse) Descriptor deprecated added in v0.1.1

func (*HostForwardResponse) Descriptor() ([]byte, []int)

Deprecated: Use HostForwardResponse.ProtoReflect.Descriptor instead.

func (*HostForwardResponse) GetBody added in v0.1.1

func (x *HostForwardResponse) GetBody() []byte

func (*HostForwardResponse) GetHeaders added in v0.1.1

func (x *HostForwardResponse) GetHeaders() map[string]*HeaderValues

func (*HostForwardResponse) GetStatusCode added in v0.1.1

func (x *HostForwardResponse) GetStatusCode() int32

func (*HostForwardResponse) GetUsage added in v0.1.1

func (x *HostForwardResponse) GetUsage() *HostForwardUsage

func (*HostForwardResponse) ProtoMessage added in v0.1.1

func (*HostForwardResponse) ProtoMessage()

func (*HostForwardResponse) ProtoReflect added in v0.1.1

func (x *HostForwardResponse) ProtoReflect() protoreflect.Message

func (*HostForwardResponse) Reset added in v0.1.1

func (x *HostForwardResponse) Reset()

func (*HostForwardResponse) String added in v0.1.1

func (x *HostForwardResponse) String() string

type HostForwardUsage added in v0.1.1

type HostForwardUsage struct {
	InputTokens  int64   `protobuf:"varint,1,opt,name=input_tokens,json=inputTokens,proto3" json:"input_tokens,omitempty"`
	OutputTokens int64   `protobuf:"varint,2,opt,name=output_tokens,json=outputTokens,proto3" json:"output_tokens,omitempty"`
	Cost         float64 `protobuf:"fixed64,3,opt,name=cost,proto3" json:"cost,omitempty"` // 总费用(已计入倍率)
	Model        string  `protobuf:"bytes,4,opt,name=model,proto3" json:"model,omitempty"` // 实际使用的 model(可能被 Core 改写)
	// contains filtered or unexported fields
}

HostForwardUsage 转发的 token / 费用摘要(Core 侧计算后回传给调用方插件)。

func (*HostForwardUsage) Descriptor deprecated added in v0.1.1

func (*HostForwardUsage) Descriptor() ([]byte, []int)

Deprecated: Use HostForwardUsage.ProtoReflect.Descriptor instead.

func (*HostForwardUsage) GetCost added in v0.1.1

func (x *HostForwardUsage) GetCost() float64

func (*HostForwardUsage) GetInputTokens added in v0.1.1

func (x *HostForwardUsage) GetInputTokens() int64

func (*HostForwardUsage) GetModel added in v0.1.1

func (x *HostForwardUsage) GetModel() string

func (*HostForwardUsage) GetOutputTokens added in v0.1.1

func (x *HostForwardUsage) GetOutputTokens() int64

func (*HostForwardUsage) ProtoMessage added in v0.1.1

func (*HostForwardUsage) ProtoMessage()

func (*HostForwardUsage) ProtoReflect added in v0.1.1

func (x *HostForwardUsage) ProtoReflect() protoreflect.Message

func (*HostForwardUsage) Reset added in v0.1.1

func (x *HostForwardUsage) Reset()

func (*HostForwardUsage) String added in v0.1.1

func (x *HostForwardUsage) String() string

type HostGetAssetBytesRequest added in v0.1.3

type HostGetAssetBytesRequest struct {
	ObjectKey string `protobuf:"bytes,1,opt,name=object_key,json=objectKey,proto3" json:"object_key,omitempty"`
	// contains filtered or unexported fields
}

func (*HostGetAssetBytesRequest) Descriptor deprecated added in v0.1.3

func (*HostGetAssetBytesRequest) Descriptor() ([]byte, []int)

Deprecated: Use HostGetAssetBytesRequest.ProtoReflect.Descriptor instead.

func (*HostGetAssetBytesRequest) GetObjectKey added in v0.1.3

func (x *HostGetAssetBytesRequest) GetObjectKey() string

func (*HostGetAssetBytesRequest) ProtoMessage added in v0.1.3

func (*HostGetAssetBytesRequest) ProtoMessage()

func (*HostGetAssetBytesRequest) ProtoReflect added in v0.1.3

func (x *HostGetAssetBytesRequest) ProtoReflect() protoreflect.Message

func (*HostGetAssetBytesRequest) Reset added in v0.1.3

func (x *HostGetAssetBytesRequest) Reset()

func (*HostGetAssetBytesRequest) String added in v0.1.3

func (x *HostGetAssetBytesRequest) String() string

type HostGetAssetBytesResponse added in v0.1.3

type HostGetAssetBytesResponse struct {
	Data        []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	ContentType string `protobuf:"bytes,2,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
	// contains filtered or unexported fields
}

func (*HostGetAssetBytesResponse) Descriptor deprecated added in v0.1.3

func (*HostGetAssetBytesResponse) Descriptor() ([]byte, []int)

Deprecated: Use HostGetAssetBytesResponse.ProtoReflect.Descriptor instead.

func (*HostGetAssetBytesResponse) GetContentType added in v0.1.3

func (x *HostGetAssetBytesResponse) GetContentType() string

func (*HostGetAssetBytesResponse) GetData added in v0.1.3

func (x *HostGetAssetBytesResponse) GetData() []byte

func (*HostGetAssetBytesResponse) ProtoMessage added in v0.1.3

func (*HostGetAssetBytesResponse) ProtoMessage()

func (*HostGetAssetBytesResponse) ProtoReflect added in v0.1.3

func (*HostGetAssetBytesResponse) Reset added in v0.1.3

func (x *HostGetAssetBytesResponse) Reset()

func (*HostGetAssetBytesResponse) String added in v0.1.3

func (x *HostGetAssetBytesResponse) String() string

type HostGetAssetURLRequest added in v0.1.2

type HostGetAssetURLRequest struct {
	ObjectKey string `protobuf:"bytes,1,opt,name=object_key,json=objectKey,proto3" json:"object_key,omitempty"`
	// contains filtered or unexported fields
}

func (*HostGetAssetURLRequest) Descriptor deprecated added in v0.1.2

func (*HostGetAssetURLRequest) Descriptor() ([]byte, []int)

Deprecated: Use HostGetAssetURLRequest.ProtoReflect.Descriptor instead.

func (*HostGetAssetURLRequest) GetObjectKey added in v0.1.2

func (x *HostGetAssetURLRequest) GetObjectKey() string

func (*HostGetAssetURLRequest) ProtoMessage added in v0.1.2

func (*HostGetAssetURLRequest) ProtoMessage()

func (*HostGetAssetURLRequest) ProtoReflect added in v0.1.2

func (x *HostGetAssetURLRequest) ProtoReflect() protoreflect.Message

func (*HostGetAssetURLRequest) Reset added in v0.1.2

func (x *HostGetAssetURLRequest) Reset()

func (*HostGetAssetURLRequest) String added in v0.1.2

func (x *HostGetAssetURLRequest) String() string

type HostGetAssetURLResponse added in v0.1.2

type HostGetAssetURLResponse struct {
	PublicUrl string `protobuf:"bytes,1,opt,name=public_url,json=publicUrl,proto3" json:"public_url,omitempty"`
	// contains filtered or unexported fields
}

func (*HostGetAssetURLResponse) Descriptor deprecated added in v0.1.2

func (*HostGetAssetURLResponse) Descriptor() ([]byte, []int)

Deprecated: Use HostGetAssetURLResponse.ProtoReflect.Descriptor instead.

func (*HostGetAssetURLResponse) GetPublicUrl added in v0.1.2

func (x *HostGetAssetURLResponse) GetPublicUrl() string

func (*HostGetAssetURLResponse) ProtoMessage added in v0.1.2

func (*HostGetAssetURLResponse) ProtoMessage()

func (*HostGetAssetURLResponse) ProtoReflect added in v0.1.2

func (x *HostGetAssetURLResponse) ProtoReflect() protoreflect.Message

func (*HostGetAssetURLResponse) Reset added in v0.1.2

func (x *HostGetAssetURLResponse) Reset()

func (*HostGetAssetURLResponse) String added in v0.1.2

func (x *HostGetAssetURLResponse) String() string

type HostGetUserInfoRequest added in v0.1.1

type HostGetUserInfoRequest struct {
	UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

func (*HostGetUserInfoRequest) Descriptor deprecated added in v0.1.1

func (*HostGetUserInfoRequest) Descriptor() ([]byte, []int)

Deprecated: Use HostGetUserInfoRequest.ProtoReflect.Descriptor instead.

func (*HostGetUserInfoRequest) GetUserId added in v0.1.1

func (x *HostGetUserInfoRequest) GetUserId() int64

func (*HostGetUserInfoRequest) ProtoMessage added in v0.1.1

func (*HostGetUserInfoRequest) ProtoMessage()

func (*HostGetUserInfoRequest) ProtoReflect added in v0.1.1

func (x *HostGetUserInfoRequest) ProtoReflect() protoreflect.Message

func (*HostGetUserInfoRequest) Reset added in v0.1.1

func (x *HostGetUserInfoRequest) Reset()

func (*HostGetUserInfoRequest) String added in v0.1.1

func (x *HostGetUserInfoRequest) String() string

type HostGetUserInfoResponse added in v0.1.1

type HostGetUserInfoResponse struct {
	UserId   int64   `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Username string  `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"`
	Email    string  `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
	Role     string  `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"` // "admin" / "user"
	Balance  float64 `protobuf:"fixed64,5,opt,name=balance,proto3" json:"balance,omitempty"`
	Status   string  `protobuf:"bytes,6,opt,name=status,proto3" json:"status,omitempty"` // "active" / "disabled"
	// contains filtered or unexported fields
}

func (*HostGetUserInfoResponse) Descriptor deprecated added in v0.1.1

func (*HostGetUserInfoResponse) Descriptor() ([]byte, []int)

Deprecated: Use HostGetUserInfoResponse.ProtoReflect.Descriptor instead.

func (*HostGetUserInfoResponse) GetBalance added in v0.1.1

func (x *HostGetUserInfoResponse) GetBalance() float64

func (*HostGetUserInfoResponse) GetEmail added in v0.1.1

func (x *HostGetUserInfoResponse) GetEmail() string

func (*HostGetUserInfoResponse) GetRole added in v0.1.1

func (x *HostGetUserInfoResponse) GetRole() string

func (*HostGetUserInfoResponse) GetStatus added in v0.1.1

func (x *HostGetUserInfoResponse) GetStatus() string

func (*HostGetUserInfoResponse) GetUserId added in v0.1.1

func (x *HostGetUserInfoResponse) GetUserId() int64

func (*HostGetUserInfoResponse) GetUsername added in v0.1.1

func (x *HostGetUserInfoResponse) GetUsername() string

func (*HostGetUserInfoResponse) ProtoMessage added in v0.1.1

func (*HostGetUserInfoResponse) ProtoMessage()

func (*HostGetUserInfoResponse) ProtoReflect added in v0.1.1

func (x *HostGetUserInfoResponse) ProtoReflect() protoreflect.Message

func (*HostGetUserInfoResponse) Reset added in v0.1.1

func (x *HostGetUserInfoResponse) Reset()

func (*HostGetUserInfoResponse) String added in v0.1.1

func (x *HostGetUserInfoResponse) String() string

type HostGroup

type HostGroup struct {
	Id             int64   `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Name           string  `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Platform       string  `protobuf:"bytes,3,opt,name=platform,proto3" json:"platform,omitempty"`
	IsExclusive    bool    `protobuf:"varint,4,opt,name=is_exclusive,json=isExclusive,proto3" json:"is_exclusive,omitempty"`
	RateMultiplier float64 `protobuf:"fixed64,5,opt,name=rate_multiplier,json=rateMultiplier,proto3" json:"rate_multiplier,omitempty"`
	// contains filtered or unexported fields
}

func (*HostGroup) Descriptor deprecated

func (*HostGroup) Descriptor() ([]byte, []int)

Deprecated: Use HostGroup.ProtoReflect.Descriptor instead.

func (*HostGroup) GetId

func (x *HostGroup) GetId() int64

func (*HostGroup) GetIsExclusive

func (x *HostGroup) GetIsExclusive() bool

func (*HostGroup) GetName

func (x *HostGroup) GetName() string

func (*HostGroup) GetPlatform

func (x *HostGroup) GetPlatform() string

func (*HostGroup) GetRateMultiplier

func (x *HostGroup) GetRateMultiplier() float64

func (*HostGroup) ProtoMessage

func (*HostGroup) ProtoMessage()

func (*HostGroup) ProtoReflect

func (x *HostGroup) ProtoReflect() protoreflect.Message

func (*HostGroup) Reset

func (x *HostGroup) Reset()

func (*HostGroup) String

func (x *HostGroup) String() string

type HostListGroupsRequest

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

func (*HostListGroupsRequest) Descriptor deprecated

func (*HostListGroupsRequest) Descriptor() ([]byte, []int)

Deprecated: Use HostListGroupsRequest.ProtoReflect.Descriptor instead.

func (*HostListGroupsRequest) ProtoMessage

func (*HostListGroupsRequest) ProtoMessage()

func (*HostListGroupsRequest) ProtoReflect

func (x *HostListGroupsRequest) ProtoReflect() protoreflect.Message

func (*HostListGroupsRequest) Reset

func (x *HostListGroupsRequest) Reset()

func (*HostListGroupsRequest) String

func (x *HostListGroupsRequest) String() string

type HostListGroupsResponse

type HostListGroupsResponse struct {
	Groups []*HostGroup `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty"`
	// contains filtered or unexported fields
}

func (*HostListGroupsResponse) Descriptor deprecated

func (*HostListGroupsResponse) Descriptor() ([]byte, []int)

Deprecated: Use HostListGroupsResponse.ProtoReflect.Descriptor instead.

func (*HostListGroupsResponse) GetGroups

func (x *HostListGroupsResponse) GetGroups() []*HostGroup

func (*HostListGroupsResponse) ProtoMessage

func (*HostListGroupsResponse) ProtoMessage()

func (*HostListGroupsResponse) ProtoReflect

func (x *HostListGroupsResponse) ProtoReflect() protoreflect.Message

func (*HostListGroupsResponse) Reset

func (x *HostListGroupsResponse) Reset()

func (*HostListGroupsResponse) String

func (x *HostListGroupsResponse) String() string

type HostListModelsRequest added in v0.1.1

type HostListModelsRequest struct {
	Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"` // 必填:平台标识
	// contains filtered or unexported fields
}

func (*HostListModelsRequest) Descriptor deprecated added in v0.1.1

func (*HostListModelsRequest) Descriptor() ([]byte, []int)

Deprecated: Use HostListModelsRequest.ProtoReflect.Descriptor instead.

func (*HostListModelsRequest) GetPlatform added in v0.1.1

func (x *HostListModelsRequest) GetPlatform() string

func (*HostListModelsRequest) ProtoMessage added in v0.1.1

func (*HostListModelsRequest) ProtoMessage()

func (*HostListModelsRequest) ProtoReflect added in v0.1.1

func (x *HostListModelsRequest) ProtoReflect() protoreflect.Message

func (*HostListModelsRequest) Reset added in v0.1.1

func (x *HostListModelsRequest) Reset()

func (*HostListModelsRequest) String added in v0.1.1

func (x *HostListModelsRequest) String() string

type HostListModelsResponse added in v0.1.1

type HostListModelsResponse struct {
	Models []*ModelInfoProto `protobuf:"bytes,1,rep,name=models,proto3" json:"models,omitempty"` // 复用已有 ModelInfoProto,避免平行数据结构漂移
	// contains filtered or unexported fields
}

func (*HostListModelsResponse) Descriptor deprecated added in v0.1.1

func (*HostListModelsResponse) Descriptor() ([]byte, []int)

Deprecated: Use HostListModelsResponse.ProtoReflect.Descriptor instead.

func (*HostListModelsResponse) GetModels added in v0.1.1

func (x *HostListModelsResponse) GetModels() []*ModelInfoProto

func (*HostListModelsResponse) ProtoMessage added in v0.1.1

func (*HostListModelsResponse) ProtoMessage()

func (*HostListModelsResponse) ProtoReflect added in v0.1.1

func (x *HostListModelsResponse) ProtoReflect() protoreflect.Message

func (*HostListModelsResponse) Reset added in v0.1.1

func (x *HostListModelsResponse) Reset()

func (*HostListModelsResponse) String added in v0.1.1

func (x *HostListModelsResponse) String() string

type HostListPlatformsRequest added in v0.1.1

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

func (*HostListPlatformsRequest) Descriptor deprecated added in v0.1.1

func (*HostListPlatformsRequest) Descriptor() ([]byte, []int)

Deprecated: Use HostListPlatformsRequest.ProtoReflect.Descriptor instead.

func (*HostListPlatformsRequest) ProtoMessage added in v0.1.1

func (*HostListPlatformsRequest) ProtoMessage()

func (*HostListPlatformsRequest) ProtoReflect added in v0.1.1

func (x *HostListPlatformsRequest) ProtoReflect() protoreflect.Message

func (*HostListPlatformsRequest) Reset added in v0.1.1

func (x *HostListPlatformsRequest) Reset()

func (*HostListPlatformsRequest) String added in v0.1.1

func (x *HostListPlatformsRequest) String() string

type HostListPlatformsResponse added in v0.1.1

type HostListPlatformsResponse struct {
	Platforms []*HostPlatform `protobuf:"bytes,1,rep,name=platforms,proto3" json:"platforms,omitempty"`
	// contains filtered or unexported fields
}

func (*HostListPlatformsResponse) Descriptor deprecated added in v0.1.1

func (*HostListPlatformsResponse) Descriptor() ([]byte, []int)

Deprecated: Use HostListPlatformsResponse.ProtoReflect.Descriptor instead.

func (*HostListPlatformsResponse) GetPlatforms added in v0.1.1

func (x *HostListPlatformsResponse) GetPlatforms() []*HostPlatform

func (*HostListPlatformsResponse) ProtoMessage added in v0.1.1

func (*HostListPlatformsResponse) ProtoMessage()

func (*HostListPlatformsResponse) ProtoReflect added in v0.1.1

func (*HostListPlatformsResponse) Reset added in v0.1.1

func (x *HostListPlatformsResponse) Reset()

func (*HostListPlatformsResponse) String added in v0.1.1

func (x *HostListPlatformsResponse) String() string

type HostPlatform added in v0.1.1

type HostPlatform struct {
	Name        string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`                                  // 平台标识(如 "openai")
	DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` // 展示名称(如 "OpenAI 网关")
	// contains filtered or unexported fields
}

func (*HostPlatform) Descriptor deprecated added in v0.1.1

func (*HostPlatform) Descriptor() ([]byte, []int)

Deprecated: Use HostPlatform.ProtoReflect.Descriptor instead.

func (*HostPlatform) GetDisplayName added in v0.1.1

func (x *HostPlatform) GetDisplayName() string

func (*HostPlatform) GetName added in v0.1.1

func (x *HostPlatform) GetName() string

func (*HostPlatform) ProtoMessage added in v0.1.1

func (*HostPlatform) ProtoMessage()

func (*HostPlatform) ProtoReflect added in v0.1.1

func (x *HostPlatform) ProtoReflect() protoreflect.Message

func (*HostPlatform) Reset added in v0.1.1

func (x *HostPlatform) Reset()

func (*HostPlatform) String added in v0.1.1

func (x *HostPlatform) String() string

type HostProbeForwardRequest

type HostProbeForwardRequest struct {
	GroupId int64  `protobuf:"varint,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	Model   string `protobuf:"bytes,2,opt,name=model,proto3" json:"model,omitempty"` // 可空:自动取 platform 第一个 model
	// contains filtered or unexported fields
}

func (*HostProbeForwardRequest) Descriptor deprecated

func (*HostProbeForwardRequest) Descriptor() ([]byte, []int)

Deprecated: Use HostProbeForwardRequest.ProtoReflect.Descriptor instead.

func (*HostProbeForwardRequest) GetGroupId

func (x *HostProbeForwardRequest) GetGroupId() int64

func (*HostProbeForwardRequest) GetModel

func (x *HostProbeForwardRequest) GetModel() string

func (*HostProbeForwardRequest) ProtoMessage

func (*HostProbeForwardRequest) ProtoMessage()

func (*HostProbeForwardRequest) ProtoReflect

func (x *HostProbeForwardRequest) ProtoReflect() protoreflect.Message

func (*HostProbeForwardRequest) Reset

func (x *HostProbeForwardRequest) Reset()

func (*HostProbeForwardRequest) String

func (x *HostProbeForwardRequest) String() string

type HostProbeForwardResponse

type HostProbeForwardResponse struct {
	Success    bool   `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	AccountId  int64  `protobuf:"varint,2,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` // 本次实际命中的账号 ID(用于运维诊断)
	Platform   string `protobuf:"bytes,3,opt,name=platform,proto3" json:"platform,omitempty"`
	Model      string `protobuf:"bytes,4,opt,name=model,proto3" json:"model,omitempty"` // 实际探测用的 model
	StatusCode int64  `protobuf:"varint,5,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
	LatencyMs  int64  `protobuf:"varint,6,opt,name=latency_ms,json=latencyMs,proto3" json:"latency_ms,omitempty"`
	ErrorKind  string `protobuf:"bytes,7,opt,name=error_kind,json=errorKind,proto3" json:"error_kind,omitempty"` // "" / "no_account" / "scheduler" / "upstream_5xx" / "timeout" / ...
	ErrorMsg   string `protobuf:"bytes,8,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"`
	// contains filtered or unexported fields
}

func (*HostProbeForwardResponse) Descriptor deprecated

func (*HostProbeForwardResponse) Descriptor() ([]byte, []int)

Deprecated: Use HostProbeForwardResponse.ProtoReflect.Descriptor instead.

func (*HostProbeForwardResponse) GetAccountId

func (x *HostProbeForwardResponse) GetAccountId() int64

func (*HostProbeForwardResponse) GetErrorKind

func (x *HostProbeForwardResponse) GetErrorKind() string

func (*HostProbeForwardResponse) GetErrorMsg

func (x *HostProbeForwardResponse) GetErrorMsg() string

func (*HostProbeForwardResponse) GetLatencyMs

func (x *HostProbeForwardResponse) GetLatencyMs() int64

func (*HostProbeForwardResponse) GetModel

func (x *HostProbeForwardResponse) GetModel() string

func (*HostProbeForwardResponse) GetPlatform

func (x *HostProbeForwardResponse) GetPlatform() string

func (*HostProbeForwardResponse) GetStatusCode

func (x *HostProbeForwardResponse) GetStatusCode() int64

func (*HostProbeForwardResponse) GetSuccess

func (x *HostProbeForwardResponse) GetSuccess() bool

func (*HostProbeForwardResponse) ProtoMessage

func (*HostProbeForwardResponse) ProtoMessage()

func (*HostProbeForwardResponse) ProtoReflect

func (x *HostProbeForwardResponse) ProtoReflect() protoreflect.Message

func (*HostProbeForwardResponse) Reset

func (x *HostProbeForwardResponse) Reset()

func (*HostProbeForwardResponse) String

func (x *HostProbeForwardResponse) String() string

type HostReportAccountResultRequest

type HostReportAccountResultRequest struct {
	AccountId int64  `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"`
	Success   bool   `protobuf:"varint,2,opt,name=success,proto3" json:"success,omitempty"`
	ErrorMsg  string `protobuf:"bytes,3,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"` // 失败时上报,便于调试
	// contains filtered or unexported fields
}

func (*HostReportAccountResultRequest) Descriptor deprecated

func (*HostReportAccountResultRequest) Descriptor() ([]byte, []int)

Deprecated: Use HostReportAccountResultRequest.ProtoReflect.Descriptor instead.

func (*HostReportAccountResultRequest) GetAccountId

func (x *HostReportAccountResultRequest) GetAccountId() int64

func (*HostReportAccountResultRequest) GetErrorMsg

func (x *HostReportAccountResultRequest) GetErrorMsg() string

func (*HostReportAccountResultRequest) GetSuccess

func (x *HostReportAccountResultRequest) GetSuccess() bool

func (*HostReportAccountResultRequest) ProtoMessage

func (*HostReportAccountResultRequest) ProtoMessage()

func (*HostReportAccountResultRequest) ProtoReflect

func (*HostReportAccountResultRequest) Reset

func (x *HostReportAccountResultRequest) Reset()

func (*HostReportAccountResultRequest) String

type HostSelectAccountRequest

type HostSelectAccountRequest struct {
	GroupId           int64   `protobuf:"varint,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	Model             string  `protobuf:"bytes,2,opt,name=model,proto3" json:"model,omitempty"`                          // 可空:空时 Core 用 platform 的第一个 model
	SessionId         string  `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` // 可空
	ExcludeAccountIds []int64 `protobuf:"varint,4,rep,packed,name=exclude_account_ids,json=excludeAccountIds,proto3" json:"exclude_account_ids,omitempty"`
	// contains filtered or unexported fields
}

func (*HostSelectAccountRequest) Descriptor deprecated

func (*HostSelectAccountRequest) Descriptor() ([]byte, []int)

Deprecated: Use HostSelectAccountRequest.ProtoReflect.Descriptor instead.

func (*HostSelectAccountRequest) GetExcludeAccountIds

func (x *HostSelectAccountRequest) GetExcludeAccountIds() []int64

func (*HostSelectAccountRequest) GetGroupId

func (x *HostSelectAccountRequest) GetGroupId() int64

func (*HostSelectAccountRequest) GetModel

func (x *HostSelectAccountRequest) GetModel() string

func (*HostSelectAccountRequest) GetSessionId

func (x *HostSelectAccountRequest) GetSessionId() string

func (*HostSelectAccountRequest) ProtoMessage

func (*HostSelectAccountRequest) ProtoMessage()

func (*HostSelectAccountRequest) ProtoReflect

func (x *HostSelectAccountRequest) ProtoReflect() protoreflect.Message

func (*HostSelectAccountRequest) Reset

func (x *HostSelectAccountRequest) Reset()

func (*HostSelectAccountRequest) String

func (x *HostSelectAccountRequest) String() string

type HostSelectAccountResponse

type HostSelectAccountResponse struct {
	AccountId   int64  `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"`
	AccountName string `protobuf:"bytes,2,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"`
	Platform    string `protobuf:"bytes,3,opt,name=platform,proto3" json:"platform,omitempty"`
	// contains filtered or unexported fields
}

func (*HostSelectAccountResponse) Descriptor deprecated

func (*HostSelectAccountResponse) Descriptor() ([]byte, []int)

Deprecated: Use HostSelectAccountResponse.ProtoReflect.Descriptor instead.

func (*HostSelectAccountResponse) GetAccountId

func (x *HostSelectAccountResponse) GetAccountId() int64

func (*HostSelectAccountResponse) GetAccountName

func (x *HostSelectAccountResponse) GetAccountName() string

func (*HostSelectAccountResponse) GetPlatform

func (x *HostSelectAccountResponse) GetPlatform() string

func (*HostSelectAccountResponse) ProtoMessage

func (*HostSelectAccountResponse) ProtoMessage()

func (*HostSelectAccountResponse) ProtoReflect

func (*HostSelectAccountResponse) Reset

func (x *HostSelectAccountResponse) Reset()

func (*HostSelectAccountResponse) String

func (x *HostSelectAccountResponse) String() string

type HostServiceClient

type HostServiceClient interface {
	// 选号:根据 (group_id, model) 走和真实用户请求完全相同的调度路径。
	SelectAccount(ctx context.Context, in *HostSelectAccountRequest, opts ...grpc.CallOption) (*HostSelectAccountResponse, error)
	// 把账号调用结果反馈给 scheduler 的失败计数器/状态机。
	ReportAccountResult(ctx context.Context, in *HostReportAccountResultRequest, opts ...grpc.CallOption) (*Empty, error)
	// 黑盒探测:内部组装一次最小的 chat completion 请求并直接执行。
	// 跳过 usage_log 写入、跳过用户余额扣款,仍然 ReportResult 反哺账号状态机。
	ProbeForward(ctx context.Context, in *HostProbeForwardRequest, opts ...grpc.CallOption) (*HostProbeForwardResponse, error)
	// 非流式业务转发:走完整管线(调度 → 网关插件 → 计费 → usage_log)。
	// 调用方需提供 user_id + group_id 以确定计费主体和调度路径。
	Forward(ctx context.Context, in *HostForwardRequest, opts ...grpc.CallOption) (*HostForwardResponse, error)
	// 流式业务转发:与 Forward 相同管线,结果通过 server stream 逐块返回。
	// 最后一块 done=true 携带 usage 信息(计费已在 Core 侧完成)。
	ForwardStream(ctx context.Context, in *HostForwardRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[HostForwardChunk], error)
	// 列出所有分组。
	ListGroups(ctx context.Context, in *HostListGroupsRequest, opts ...grpc.CallOption) (*HostListGroupsResponse, error)
	// 列出已加载的网关平台(每个 gateway 插件对应一个 platform)。
	ListPlatforms(ctx context.Context, in *HostListPlatformsRequest, opts ...grpc.CallOption) (*HostListPlatformsResponse, error)
	// 列出指定平台的模型列表。
	ListModels(ctx context.Context, in *HostListModelsRequest, opts ...grpc.CallOption) (*HostListModelsResponse, error)
	// 获取用户基本信息(余额、角色、状态)。
	GetUserInfo(ctx context.Context, in *HostGetUserInfoRequest, opts ...grpc.CallOption) (*HostGetUserInfoResponse, error)
	// 资产存储:由 Core 根据全局 storage 设置选择 MinIO/S3 或本地磁盘。
	StoreAsset(ctx context.Context, in *HostStoreAssetRequest, opts ...grpc.CallOption) (*HostStoreAssetResponse, error)
	GetAssetURL(ctx context.Context, in *HostGetAssetURLRequest, opts ...grpc.CallOption) (*HostGetAssetURLResponse, error)
	GetAssetBytes(ctx context.Context, in *HostGetAssetBytesRequest, opts ...grpc.CallOption) (*HostGetAssetBytesResponse, error)
}

HostServiceClient is the client API for HostService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type HostServiceServer

type HostServiceServer interface {
	// 选号:根据 (group_id, model) 走和真实用户请求完全相同的调度路径。
	SelectAccount(context.Context, *HostSelectAccountRequest) (*HostSelectAccountResponse, error)
	// 把账号调用结果反馈给 scheduler 的失败计数器/状态机。
	ReportAccountResult(context.Context, *HostReportAccountResultRequest) (*Empty, error)
	// 黑盒探测:内部组装一次最小的 chat completion 请求并直接执行。
	// 跳过 usage_log 写入、跳过用户余额扣款,仍然 ReportResult 反哺账号状态机。
	ProbeForward(context.Context, *HostProbeForwardRequest) (*HostProbeForwardResponse, error)
	// 非流式业务转发:走完整管线(调度 → 网关插件 → 计费 → usage_log)。
	// 调用方需提供 user_id + group_id 以确定计费主体和调度路径。
	Forward(context.Context, *HostForwardRequest) (*HostForwardResponse, error)
	// 流式业务转发:与 Forward 相同管线,结果通过 server stream 逐块返回。
	// 最后一块 done=true 携带 usage 信息(计费已在 Core 侧完成)。
	ForwardStream(*HostForwardRequest, grpc.ServerStreamingServer[HostForwardChunk]) error
	// 列出所有分组。
	ListGroups(context.Context, *HostListGroupsRequest) (*HostListGroupsResponse, error)
	// 列出已加载的网关平台(每个 gateway 插件对应一个 platform)。
	ListPlatforms(context.Context, *HostListPlatformsRequest) (*HostListPlatformsResponse, error)
	// 列出指定平台的模型列表。
	ListModels(context.Context, *HostListModelsRequest) (*HostListModelsResponse, error)
	// 获取用户基本信息(余额、角色、状态)。
	GetUserInfo(context.Context, *HostGetUserInfoRequest) (*HostGetUserInfoResponse, error)
	// 资产存储:由 Core 根据全局 storage 设置选择 MinIO/S3 或本地磁盘。
	StoreAsset(context.Context, *HostStoreAssetRequest) (*HostStoreAssetResponse, error)
	GetAssetURL(context.Context, *HostGetAssetURLRequest) (*HostGetAssetURLResponse, error)
	GetAssetBytes(context.Context, *HostGetAssetBytesRequest) (*HostGetAssetBytesResponse, error)
	// contains filtered or unexported methods
}

HostServiceServer is the server API for HostService service. All implementations must embed UnimplementedHostServiceServer for forward compatibility.

type HostService_ForwardStreamClient added in v0.1.1

type HostService_ForwardStreamClient = grpc.ServerStreamingClient[HostForwardChunk]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type HostService_ForwardStreamServer added in v0.1.1

type HostService_ForwardStreamServer = grpc.ServerStreamingServer[HostForwardChunk]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type HostStoreAssetRequest added in v0.1.2

type HostStoreAssetRequest struct {
	UserId        int64  `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Scope         string `protobuf:"bytes,2,opt,name=scope,proto3" json:"scope,omitempty"`
	ContentType   string `protobuf:"bytes,3,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
	Data          []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
	FileExtension string `protobuf:"bytes,5,opt,name=file_extension,json=fileExtension,proto3" json:"file_extension,omitempty"`
	// contains filtered or unexported fields
}

func (*HostStoreAssetRequest) Descriptor deprecated added in v0.1.2

func (*HostStoreAssetRequest) Descriptor() ([]byte, []int)

Deprecated: Use HostStoreAssetRequest.ProtoReflect.Descriptor instead.

func (*HostStoreAssetRequest) GetContentType added in v0.1.2

func (x *HostStoreAssetRequest) GetContentType() string

func (*HostStoreAssetRequest) GetData added in v0.1.2

func (x *HostStoreAssetRequest) GetData() []byte

func (*HostStoreAssetRequest) GetFileExtension added in v0.1.2

func (x *HostStoreAssetRequest) GetFileExtension() string

func (*HostStoreAssetRequest) GetScope added in v0.1.2

func (x *HostStoreAssetRequest) GetScope() string

func (*HostStoreAssetRequest) GetUserId added in v0.1.2

func (x *HostStoreAssetRequest) GetUserId() int64

func (*HostStoreAssetRequest) ProtoMessage added in v0.1.2

func (*HostStoreAssetRequest) ProtoMessage()

func (*HostStoreAssetRequest) ProtoReflect added in v0.1.2

func (x *HostStoreAssetRequest) ProtoReflect() protoreflect.Message

func (*HostStoreAssetRequest) Reset added in v0.1.2

func (x *HostStoreAssetRequest) Reset()

func (*HostStoreAssetRequest) String added in v0.1.2

func (x *HostStoreAssetRequest) String() string

type HostStoreAssetResponse added in v0.1.2

type HostStoreAssetResponse struct {
	AssetId     string `protobuf:"bytes,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"`
	ObjectKey   string `protobuf:"bytes,2,opt,name=object_key,json=objectKey,proto3" json:"object_key,omitempty"`
	PublicUrl   string `protobuf:"bytes,3,opt,name=public_url,json=publicUrl,proto3" json:"public_url,omitempty"`
	SizeBytes   int64  `protobuf:"varint,4,opt,name=size_bytes,json=sizeBytes,proto3" json:"size_bytes,omitempty"`
	ContentType string `protobuf:"bytes,5,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"`
	// contains filtered or unexported fields
}

func (*HostStoreAssetResponse) Descriptor deprecated added in v0.1.2

func (*HostStoreAssetResponse) Descriptor() ([]byte, []int)

Deprecated: Use HostStoreAssetResponse.ProtoReflect.Descriptor instead.

func (*HostStoreAssetResponse) GetAssetId added in v0.1.2

func (x *HostStoreAssetResponse) GetAssetId() string

func (*HostStoreAssetResponse) GetContentType added in v0.1.2

func (x *HostStoreAssetResponse) GetContentType() string

func (*HostStoreAssetResponse) GetObjectKey added in v0.1.2

func (x *HostStoreAssetResponse) GetObjectKey() string

func (*HostStoreAssetResponse) GetPublicUrl added in v0.1.2

func (x *HostStoreAssetResponse) GetPublicUrl() string

func (*HostStoreAssetResponse) GetSizeBytes added in v0.1.2

func (x *HostStoreAssetResponse) GetSizeBytes() int64

func (*HostStoreAssetResponse) ProtoMessage added in v0.1.2

func (*HostStoreAssetResponse) ProtoMessage()

func (*HostStoreAssetResponse) ProtoReflect added in v0.1.2

func (x *HostStoreAssetResponse) ProtoReflect() protoreflect.Message

func (*HostStoreAssetResponse) Reset added in v0.1.2

func (x *HostStoreAssetResponse) Reset()

func (*HostStoreAssetResponse) String added in v0.1.2

func (x *HostStoreAssetResponse) String() string

type HttpRequest

type HttpRequest struct {
	Method     string                   `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"`
	Path       string                   `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	Query      string                   `protobuf:"bytes,3,opt,name=query,proto3" json:"query,omitempty"`
	Headers    map[string]*HeaderValues `` /* 141-byte string literal not displayed */
	Body       []byte                   `protobuf:"bytes,5,opt,name=body,proto3" json:"body,omitempty"`
	RemoteAddr string                   `protobuf:"bytes,6,opt,name=remote_addr,json=remoteAddr,proto3" json:"remote_addr,omitempty"`
	// contains filtered or unexported fields
}

func (*HttpRequest) Descriptor deprecated

func (*HttpRequest) Descriptor() ([]byte, []int)

Deprecated: Use HttpRequest.ProtoReflect.Descriptor instead.

func (*HttpRequest) GetBody

func (x *HttpRequest) GetBody() []byte

func (*HttpRequest) GetHeaders

func (x *HttpRequest) GetHeaders() map[string]*HeaderValues

func (*HttpRequest) GetMethod

func (x *HttpRequest) GetMethod() string

func (*HttpRequest) GetPath

func (x *HttpRequest) GetPath() string

func (*HttpRequest) GetQuery

func (x *HttpRequest) GetQuery() string

func (*HttpRequest) GetRemoteAddr

func (x *HttpRequest) GetRemoteAddr() string

func (*HttpRequest) ProtoMessage

func (*HttpRequest) ProtoMessage()

func (*HttpRequest) ProtoReflect

func (x *HttpRequest) ProtoReflect() protoreflect.Message

func (*HttpRequest) Reset

func (x *HttpRequest) Reset()

func (*HttpRequest) String

func (x *HttpRequest) String() string

type HttpResponse

type HttpResponse struct {
	StatusCode int32                    `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
	Headers    map[string]*HeaderValues `` /* 141-byte string literal not displayed */
	Body       []byte                   `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

func (*HttpResponse) Descriptor deprecated

func (*HttpResponse) Descriptor() ([]byte, []int)

Deprecated: Use HttpResponse.ProtoReflect.Descriptor instead.

func (*HttpResponse) GetBody

func (x *HttpResponse) GetBody() []byte

func (*HttpResponse) GetHeaders

func (x *HttpResponse) GetHeaders() map[string]*HeaderValues

func (*HttpResponse) GetStatusCode

func (x *HttpResponse) GetStatusCode() int32

func (*HttpResponse) ProtoMessage

func (*HttpResponse) ProtoMessage()

func (*HttpResponse) ProtoReflect

func (x *HttpResponse) ProtoReflect() protoreflect.Message

func (*HttpResponse) Reset

func (x *HttpResponse) Reset()

func (*HttpResponse) String

func (x *HttpResponse) String() string

type HttpResponseChunk

type HttpResponseChunk struct {
	Data       []byte                   `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	Done       bool                     `protobuf:"varint,2,opt,name=done,proto3" json:"done,omitempty"`
	StatusCode int32                    `protobuf:"varint,3,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
	Headers    map[string]*HeaderValues `` /* 141-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*HttpResponseChunk) Descriptor deprecated

func (*HttpResponseChunk) Descriptor() ([]byte, []int)

Deprecated: Use HttpResponseChunk.ProtoReflect.Descriptor instead.

func (*HttpResponseChunk) GetData

func (x *HttpResponseChunk) GetData() []byte

func (*HttpResponseChunk) GetDone

func (x *HttpResponseChunk) GetDone() bool

func (*HttpResponseChunk) GetHeaders

func (x *HttpResponseChunk) GetHeaders() map[string]*HeaderValues

func (*HttpResponseChunk) GetStatusCode

func (x *HttpResponseChunk) GetStatusCode() int32

func (*HttpResponseChunk) ProtoMessage

func (*HttpResponseChunk) ProtoMessage()

func (*HttpResponseChunk) ProtoReflect

func (x *HttpResponseChunk) ProtoReflect() protoreflect.Message

func (*HttpResponseChunk) Reset

func (x *HttpResponseChunk) Reset()

func (*HttpResponseChunk) String

func (x *HttpResponseChunk) String() string

type InitRequest

type InitRequest struct {
	Config   map[string]string `` /* 139-byte string literal not displayed */
	LogLevel string            `protobuf:"bytes,2,opt,name=log_level,json=logLevel,proto3" json:"log_level,omitempty"`
	// host_broker_id 是 Core 通过 hashicorp/go-plugin GRPCBroker 启动的
	// HostService stream 的 ID。插件 Init 时拿到 ID 后,可以通过 broker.Dial(id)
	// 拿到 HostService 的 grpc client,回调 Core 提供的能力(SelectAccount /
	// ProbeForward / ListGroups 等)。0 表示 Core 没启用 HostService。
	HostBrokerId uint32 `protobuf:"varint,3,opt,name=host_broker_id,json=hostBrokerId,proto3" json:"host_broker_id,omitempty"`
	// contains filtered or unexported fields
}

func (*InitRequest) Descriptor deprecated

func (*InitRequest) Descriptor() ([]byte, []int)

Deprecated: Use InitRequest.ProtoReflect.Descriptor instead.

func (*InitRequest) GetConfig

func (x *InitRequest) GetConfig() map[string]string

func (*InitRequest) GetHostBrokerId

func (x *InitRequest) GetHostBrokerId() uint32

func (*InitRequest) GetLogLevel

func (x *InitRequest) GetLogLevel() string

func (*InitRequest) ProtoMessage

func (*InitRequest) ProtoMessage()

func (*InitRequest) ProtoReflect

func (x *InitRequest) ProtoReflect() protoreflect.Message

func (*InitRequest) Reset

func (x *InitRequest) Reset()

func (*InitRequest) String

func (x *InitRequest) String() string

type MiddlewareDecision

type MiddlewareDecision struct {
	Action MiddlewareDecision_Action `protobuf:"varint,1,opt,name=action,proto3,enum=airgate.plugin.v1.MiddlewareDecision_Action" json:"action,omitempty"`
	// action=DENY 时的错误码 / 文案(对用户可见)
	DenyStatusCode int32  `protobuf:"varint,10,opt,name=deny_status_code,json=denyStatusCode,proto3" json:"deny_status_code,omitempty"` // 默认 403 if Action=DENY and 未指定
	DenyMessage    string `protobuf:"bytes,11,opt,name=deny_message,json=denyMessage,proto3" json:"deny_message,omitempty"`
	// action=MUTATE 时要追加/覆盖的请求头
	SetHeaders map[string]*HeaderValues `` /* 166-byte string literal not displayed */
	// 贯穿式 metadata:无论 allow/deny/mutate,都能往 bag 里写东西供后续 middleware / End 使用
	Metadata map[string]string `` /* 144-byte string literal not displayed */
	// contains filtered or unexported fields
}

MiddlewareDecision OnForwardBegin 的输出:放行 / 拒绝 / 改请求。

func (*MiddlewareDecision) Descriptor deprecated

func (*MiddlewareDecision) Descriptor() ([]byte, []int)

Deprecated: Use MiddlewareDecision.ProtoReflect.Descriptor instead.

func (*MiddlewareDecision) GetAction

func (*MiddlewareDecision) GetDenyMessage

func (x *MiddlewareDecision) GetDenyMessage() string

func (*MiddlewareDecision) GetDenyStatusCode

func (x *MiddlewareDecision) GetDenyStatusCode() int32

func (*MiddlewareDecision) GetMetadata

func (x *MiddlewareDecision) GetMetadata() map[string]string

func (*MiddlewareDecision) GetSetHeaders

func (x *MiddlewareDecision) GetSetHeaders() map[string]*HeaderValues

func (*MiddlewareDecision) ProtoMessage

func (*MiddlewareDecision) ProtoMessage()

func (*MiddlewareDecision) ProtoReflect

func (x *MiddlewareDecision) ProtoReflect() protoreflect.Message

func (*MiddlewareDecision) Reset

func (x *MiddlewareDecision) Reset()

func (*MiddlewareDecision) String

func (x *MiddlewareDecision) String() string

type MiddlewareDecision_Action

type MiddlewareDecision_Action int32
const (
	MiddlewareDecision_ALLOW  MiddlewareDecision_Action = 0 // 默认放行
	MiddlewareDecision_DENY   MiddlewareDecision_Action = 1 // 拒绝请求,status_code + error_message 会直接返回给用户
	MiddlewareDecision_MUTATE MiddlewareDecision_Action = 2 // 放行但修改请求(当前只支持 set_headers)
)

func (MiddlewareDecision_Action) Descriptor

func (MiddlewareDecision_Action) Enum

func (MiddlewareDecision_Action) EnumDescriptor deprecated

func (MiddlewareDecision_Action) EnumDescriptor() ([]byte, []int)

Deprecated: Use MiddlewareDecision_Action.Descriptor instead.

func (MiddlewareDecision_Action) Number

func (MiddlewareDecision_Action) String

func (x MiddlewareDecision_Action) String() string

func (MiddlewareDecision_Action) Type

type MiddlewareEvent

type MiddlewareEvent struct {

	// === 核心元数据(与 MiddlewareRequest 对齐)===
	RequestId      string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	UserId         int64  `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	GroupId        int64  `protobuf:"varint,3,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	AccountId      int64  `protobuf:"varint,4,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"`
	Platform       string `protobuf:"bytes,5,opt,name=platform,proto3" json:"platform,omitempty"`
	Model          string `protobuf:"bytes,6,opt,name=model,proto3" json:"model,omitempty"`
	Stream         bool   `protobuf:"varint,7,opt,name=stream,proto3" json:"stream,omitempty"`
	InputTokensEst int64  `protobuf:"varint,8,opt,name=input_tokens_est,json=inputTokensEst,proto3" json:"input_tokens_est,omitempty"` // 与 MiddlewareRequest 字段对齐:core 侧粗略估算,
	// === 响应结果 ===
	StatusCode        int64  `protobuf:"varint,20,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
	DurationMs        int64  `protobuf:"varint,21,opt,name=duration_ms,json=durationMs,proto3" json:"duration_ms,omitempty"`
	InputTokens       int64  `protobuf:"varint,22,opt,name=input_tokens,json=inputTokens,proto3" json:"input_tokens,omitempty"`
	OutputTokens      int64  `protobuf:"varint,23,opt,name=output_tokens,json=outputTokens,proto3" json:"output_tokens,omitempty"`
	CachedInputTokens int64  `protobuf:"varint,24,opt,name=cached_input_tokens,json=cachedInputTokens,proto3" json:"cached_input_tokens,omitempty"`
	FirstTokenMs      int64  `protobuf:"varint,25,opt,name=first_token_ms,json=firstTokenMs,proto3" json:"first_token_ms,omitempty"`
	ErrorKind         string `protobuf:"bytes,26,opt,name=error_kind,json=errorKind,proto3" json:"error_kind,omitempty"` // "" / "upstream_5xx" / "timeout" / "no_account" / ...
	ErrorMsg          string `protobuf:"bytes,27,opt,name=error_msg,json=errorMsg,proto3" json:"error_msg,omitempty"`    // 限长 512,见 core 实现
	// 费用快照(core 已计算好)
	InputCost       float64 `protobuf:"fixed64,30,opt,name=input_cost,json=inputCost,proto3" json:"input_cost,omitempty"`
	OutputCost      float64 `protobuf:"fixed64,31,opt,name=output_cost,json=outputCost,proto3" json:"output_cost,omitempty"`
	CachedInputCost float64 `protobuf:"fixed64,32,opt,name=cached_input_cost,json=cachedInputCost,proto3" json:"cached_input_cost,omitempty"`
	// metadata 延续自 OnForwardBegin 的 bag
	Metadata map[string]string `` /* 144-byte string literal not displayed */
	// === 按需字段(声明了 middleware.read_body capability 的插件才会收到)===
	// 流式响应时 response_body 只给摘要(首次非空 chunk 拼装),完整流式内容
	// 留给未来的 OnStreamChunk(ADR-0002)。
	ResponseBody    []byte                   `protobuf:"bytes,100,opt,name=response_body,json=responseBody,proto3" json:"response_body,omitempty"`
	ResponseHeaders map[string]*HeaderValues `` /* 182-byte string literal not displayed */
	// contains filtered or unexported fields
}

MiddlewareEvent OnForwardEnd 的输入:完整的请求 + 响应元数据。

func (*MiddlewareEvent) Descriptor deprecated

func (*MiddlewareEvent) Descriptor() ([]byte, []int)

Deprecated: Use MiddlewareEvent.ProtoReflect.Descriptor instead.

func (*MiddlewareEvent) GetAccountId

func (x *MiddlewareEvent) GetAccountId() int64

func (*MiddlewareEvent) GetCachedInputCost

func (x *MiddlewareEvent) GetCachedInputCost() float64

func (*MiddlewareEvent) GetCachedInputTokens

func (x *MiddlewareEvent) GetCachedInputTokens() int64

func (*MiddlewareEvent) GetDurationMs

func (x *MiddlewareEvent) GetDurationMs() int64

func (*MiddlewareEvent) GetErrorKind

func (x *MiddlewareEvent) GetErrorKind() string

func (*MiddlewareEvent) GetErrorMsg

func (x *MiddlewareEvent) GetErrorMsg() string

func (*MiddlewareEvent) GetFirstTokenMs

func (x *MiddlewareEvent) GetFirstTokenMs() int64

func (*MiddlewareEvent) GetGroupId

func (x *MiddlewareEvent) GetGroupId() int64

func (*MiddlewareEvent) GetInputCost

func (x *MiddlewareEvent) GetInputCost() float64

func (*MiddlewareEvent) GetInputTokens

func (x *MiddlewareEvent) GetInputTokens() int64

func (*MiddlewareEvent) GetInputTokensEst

func (x *MiddlewareEvent) GetInputTokensEst() int64

func (*MiddlewareEvent) GetMetadata

func (x *MiddlewareEvent) GetMetadata() map[string]string

func (*MiddlewareEvent) GetModel

func (x *MiddlewareEvent) GetModel() string

func (*MiddlewareEvent) GetOutputCost

func (x *MiddlewareEvent) GetOutputCost() float64

func (*MiddlewareEvent) GetOutputTokens

func (x *MiddlewareEvent) GetOutputTokens() int64

func (*MiddlewareEvent) GetPlatform

func (x *MiddlewareEvent) GetPlatform() string

func (*MiddlewareEvent) GetRequestId

func (x *MiddlewareEvent) GetRequestId() string

func (*MiddlewareEvent) GetResponseBody

func (x *MiddlewareEvent) GetResponseBody() []byte

func (*MiddlewareEvent) GetResponseHeaders

func (x *MiddlewareEvent) GetResponseHeaders() map[string]*HeaderValues

func (*MiddlewareEvent) GetStatusCode

func (x *MiddlewareEvent) GetStatusCode() int64

func (*MiddlewareEvent) GetStream

func (x *MiddlewareEvent) GetStream() bool

func (*MiddlewareEvent) GetUserId

func (x *MiddlewareEvent) GetUserId() int64

func (*MiddlewareEvent) ProtoMessage

func (*MiddlewareEvent) ProtoMessage()

func (*MiddlewareEvent) ProtoReflect

func (x *MiddlewareEvent) ProtoReflect() protoreflect.Message

func (*MiddlewareEvent) Reset

func (x *MiddlewareEvent) Reset()

func (*MiddlewareEvent) String

func (x *MiddlewareEvent) String() string

type MiddlewareRequest

type MiddlewareRequest struct {

	// === 核心元数据(默认总是填充)===
	RequestId      string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` // core 为本次请求分配的唯一 ID(便于跨 Begin/End 关联)
	UserId         int64  `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	GroupId        int64  `protobuf:"varint,3,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	AccountId      int64  `protobuf:"varint,4,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` // 已由 scheduler 选出
	Platform       string `protobuf:"bytes,5,opt,name=platform,proto3" json:"platform,omitempty"`
	Model          string `protobuf:"bytes,6,opt,name=model,proto3" json:"model,omitempty"`
	Stream         bool   `protobuf:"varint,7,opt,name=stream,proto3" json:"stream,omitempty"`
	InputTokensEst int64  `protobuf:"varint,8,opt,name=input_tokens_est,json=inputTokensEst,proto3" json:"input_tokens_est,omitempty"` // core 侧粗略估算,仅用于早期决策
	// metadata KV bag:供多个 middleware 之间传递上下文(Open Question Q-open-3)。
	// 命名空间规则暂不强制,未来可能收紧。
	Metadata map[string]string `` /* 143-byte string literal not displayed */
	// === 按需字段(声明了 middleware.read_body capability 的插件才会收到)===
	RequestBody    []byte                   `protobuf:"bytes,100,opt,name=request_body,json=requestBody,proto3" json:"request_body,omitempty"`
	RequestHeaders map[string]*HeaderValues `` /* 179-byte string literal not displayed */
	// contains filtered or unexported fields
}

MiddlewareRequest OnForwardBegin 的输入:请求元数据 + 可选的 request body。

func (*MiddlewareRequest) Descriptor deprecated

func (*MiddlewareRequest) Descriptor() ([]byte, []int)

Deprecated: Use MiddlewareRequest.ProtoReflect.Descriptor instead.

func (*MiddlewareRequest) GetAccountId

func (x *MiddlewareRequest) GetAccountId() int64

func (*MiddlewareRequest) GetGroupId

func (x *MiddlewareRequest) GetGroupId() int64

func (*MiddlewareRequest) GetInputTokensEst

func (x *MiddlewareRequest) GetInputTokensEst() int64

func (*MiddlewareRequest) GetMetadata

func (x *MiddlewareRequest) GetMetadata() map[string]string

func (*MiddlewareRequest) GetModel

func (x *MiddlewareRequest) GetModel() string

func (*MiddlewareRequest) GetPlatform

func (x *MiddlewareRequest) GetPlatform() string

func (*MiddlewareRequest) GetRequestBody

func (x *MiddlewareRequest) GetRequestBody() []byte

func (*MiddlewareRequest) GetRequestHeaders

func (x *MiddlewareRequest) GetRequestHeaders() map[string]*HeaderValues

func (*MiddlewareRequest) GetRequestId

func (x *MiddlewareRequest) GetRequestId() string

func (*MiddlewareRequest) GetStream

func (x *MiddlewareRequest) GetStream() bool

func (*MiddlewareRequest) GetUserId

func (x *MiddlewareRequest) GetUserId() int64

func (*MiddlewareRequest) ProtoMessage

func (*MiddlewareRequest) ProtoMessage()

func (*MiddlewareRequest) ProtoReflect

func (x *MiddlewareRequest) ProtoReflect() protoreflect.Message

func (*MiddlewareRequest) Reset

func (x *MiddlewareRequest) Reset()

func (*MiddlewareRequest) String

func (x *MiddlewareRequest) String() string

type MiddlewareServiceClient

type MiddlewareServiceClient interface {
	OnForwardBegin(ctx context.Context, in *MiddlewareRequest, opts ...grpc.CallOption) (*MiddlewareDecision, error)
	OnForwardEnd(ctx context.Context, in *MiddlewareEvent, opts ...grpc.CallOption) (*Empty, error)
}

MiddlewareServiceClient is the client API for MiddlewareService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

==================== 中间件服务(Core → Plugin,forward 路径拦截) ====================

MiddlewareService 让"请求中间层"这种旁路插件能拿到每次 forward 的前后事件:

  • OnForwardBegin — 选完账号 / 还没调 upstream 之前,能改 headers / 拒绝请求
  • OnForwardEnd — upstream 返回之后 / 写 usage_log 之前,拿到完整 metadata

设计原则(详见 ADR-0001 Decision 2/3):

  1. middleware 挂了不能 block 生产:返回 error 只 log warn,流程继续; 只有 OnForwardBegin 明确返回 Action=DENY 才会拒绝请求
  2. 多个 middleware 按 priority 排序。Begin 升序、End 降序(LIFO)
  3. payload 两段式:默认只传元数据,声明 middleware.read_body capability 的插件 才会收到 request_body / response_body
  4. 流式响应的 response_body 只给摘要(首次非空 chunk 拼装),完整流式内容留给 未来的 OnStreamChunk(ADR-0002)

新角色:middleware 插件不是 gateway(不替代 upstream),也不是 extension (不跑后台任务 + 自定义 HTTP)。它在 PluginInfo.type = "middleware" 中声明。

type MiddlewareServiceServer

type MiddlewareServiceServer interface {
	OnForwardBegin(context.Context, *MiddlewareRequest) (*MiddlewareDecision, error)
	OnForwardEnd(context.Context, *MiddlewareEvent) (*Empty, error)
	// contains filtered or unexported methods
}

MiddlewareServiceServer is the server API for MiddlewareService service. All implementations must embed UnimplementedMiddlewareServiceServer for forward compatibility.

==================== 中间件服务(Core → Plugin,forward 路径拦截) ====================

MiddlewareService 让"请求中间层"这种旁路插件能拿到每次 forward 的前后事件:

  • OnForwardBegin — 选完账号 / 还没调 upstream 之前,能改 headers / 拒绝请求
  • OnForwardEnd — upstream 返回之后 / 写 usage_log 之前,拿到完整 metadata

设计原则(详见 ADR-0001 Decision 2/3):

  1. middleware 挂了不能 block 生产:返回 error 只 log warn,流程继续; 只有 OnForwardBegin 明确返回 Action=DENY 才会拒绝请求
  2. 多个 middleware 按 priority 排序。Begin 升序、End 降序(LIFO)
  3. payload 两段式:默认只传元数据,声明 middleware.read_body capability 的插件 才会收到 request_body / response_body
  4. 流式响应的 response_body 只给摘要(首次非空 chunk 拼装),完整流式内容留给 未来的 OnStreamChunk(ADR-0002)

新角色:middleware 插件不是 gateway(不替代 upstream),也不是 extension (不跑后台任务 + 自定义 HTTP)。它在 PluginInfo.type = "middleware" 中声明。

type ModelInfoProto

type ModelInfoProto struct {
	Id                       string  `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name                     string  `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	InputPrice               float64 `protobuf:"fixed64,4,opt,name=input_price,json=inputPrice,proto3" json:"input_price,omitempty"`
	OutputPrice              float64 `protobuf:"fixed64,5,opt,name=output_price,json=outputPrice,proto3" json:"output_price,omitempty"`
	CachedInputPrice         float64 `protobuf:"fixed64,6,opt,name=cached_input_price,json=cachedInputPrice,proto3" json:"cached_input_price,omitempty"`
	InputPricePriority       float64 `protobuf:"fixed64,7,opt,name=input_price_priority,json=inputPricePriority,proto3" json:"input_price_priority,omitempty"`
	OutputPricePriority      float64 `protobuf:"fixed64,8,opt,name=output_price_priority,json=outputPricePriority,proto3" json:"output_price_priority,omitempty"`
	CachedInputPricePriority float64 `` /* 139-byte string literal not displayed */
	ContextWindow            int64   `protobuf:"varint,10,opt,name=context_window,json=contextWindow,proto3" json:"context_window,omitempty"`
	MaxOutputTokens          int64   `protobuf:"varint,11,opt,name=max_output_tokens,json=maxOutputTokens,proto3" json:"max_output_tokens,omitempty"`
	CacheCreationPrice       float64 `protobuf:"fixed64,12,opt,name=cache_creation_price,json=cacheCreationPrice,proto3" json:"cache_creation_price,omitempty"` // 缓存写入 5m TTL 单价($/1M token,1.25x input)
	CacheCreation_1HPrice    float64 ``                                                                                                                         // 缓存写入 1h TTL 单价($/1M token,2.00x input)
	/* 128-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ModelInfoProto) Descriptor deprecated

func (*ModelInfoProto) Descriptor() ([]byte, []int)

Deprecated: Use ModelInfoProto.ProtoReflect.Descriptor instead.

func (*ModelInfoProto) GetCacheCreationPrice

func (x *ModelInfoProto) GetCacheCreationPrice() float64

func (*ModelInfoProto) GetCacheCreation_1HPrice

func (x *ModelInfoProto) GetCacheCreation_1HPrice() float64

func (*ModelInfoProto) GetCachedInputPrice

func (x *ModelInfoProto) GetCachedInputPrice() float64

func (*ModelInfoProto) GetCachedInputPricePriority

func (x *ModelInfoProto) GetCachedInputPricePriority() float64

func (*ModelInfoProto) GetContextWindow

func (x *ModelInfoProto) GetContextWindow() int64

func (*ModelInfoProto) GetId

func (x *ModelInfoProto) GetId() string

func (*ModelInfoProto) GetInputPrice

func (x *ModelInfoProto) GetInputPrice() float64

func (*ModelInfoProto) GetInputPricePriority

func (x *ModelInfoProto) GetInputPricePriority() float64

func (*ModelInfoProto) GetMaxOutputTokens

func (x *ModelInfoProto) GetMaxOutputTokens() int64

func (*ModelInfoProto) GetName

func (x *ModelInfoProto) GetName() string

func (*ModelInfoProto) GetOutputPrice

func (x *ModelInfoProto) GetOutputPrice() float64

func (*ModelInfoProto) GetOutputPricePriority

func (x *ModelInfoProto) GetOutputPricePriority() float64

func (*ModelInfoProto) ProtoMessage

func (*ModelInfoProto) ProtoMessage()

func (*ModelInfoProto) ProtoReflect

func (x *ModelInfoProto) ProtoReflect() protoreflect.Message

func (*ModelInfoProto) Reset

func (x *ModelInfoProto) Reset()

func (*ModelInfoProto) String

func (x *ModelInfoProto) String() string

type ModelsResponse

type ModelsResponse struct {
	Models []*ModelInfoProto `protobuf:"bytes,1,rep,name=models,proto3" json:"models,omitempty"`
	// contains filtered or unexported fields
}

func (*ModelsResponse) Descriptor deprecated

func (*ModelsResponse) Descriptor() ([]byte, []int)

Deprecated: Use ModelsResponse.ProtoReflect.Descriptor instead.

func (*ModelsResponse) GetModels

func (x *ModelsResponse) GetModels() []*ModelInfoProto

func (*ModelsResponse) ProtoMessage

func (*ModelsResponse) ProtoMessage()

func (*ModelsResponse) ProtoReflect

func (x *ModelsResponse) ProtoReflect() protoreflect.Message

func (*ModelsResponse) Reset

func (x *ModelsResponse) Reset()

func (*ModelsResponse) String

func (x *ModelsResponse) String() string

type OutcomeKind

type OutcomeKind int32

OutcomeKind 插件对一次 Forward 的判决。 字段值与 sdk.OutcomeKind 常量一一对应;0 = UNKNOWN(插件未声明)。

const (
	OutcomeKind_OUTCOME_UNKNOWN              OutcomeKind = 0
	OutcomeKind_OUTCOME_SUCCESS              OutcomeKind = 1
	OutcomeKind_OUTCOME_CLIENT_ERROR         OutcomeKind = 2
	OutcomeKind_OUTCOME_ACCOUNT_RATE_LIMITED OutcomeKind = 3
	OutcomeKind_OUTCOME_ACCOUNT_DEAD         OutcomeKind = 4
	OutcomeKind_OUTCOME_UPSTREAM_TRANSIENT   OutcomeKind = 5
	OutcomeKind_OUTCOME_STREAM_ABORTED       OutcomeKind = 6
)

func (OutcomeKind) Descriptor

func (OutcomeKind) Enum

func (x OutcomeKind) Enum() *OutcomeKind

func (OutcomeKind) EnumDescriptor deprecated

func (OutcomeKind) EnumDescriptor() ([]byte, []int)

Deprecated: Use OutcomeKind.Descriptor instead.

func (OutcomeKind) Number

func (x OutcomeKind) Number() protoreflect.EnumNumber

func (OutcomeKind) String

func (x OutcomeKind) String() string

func (OutcomeKind) Type

type PluginInfoResponse

type PluginInfoResponse struct {
	Id                 string                 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name               string                 `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Version            string                 `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
	Description        string                 `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
	Author             string                 `protobuf:"bytes,5,opt,name=author,proto3" json:"author,omitempty"`
	Type               string                 `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"`
	AccountTypes       []*AccountTypeProto    `protobuf:"bytes,7,rep,name=account_types,json=accountTypes,proto3" json:"account_types,omitempty"`
	FrontendPages      []*FrontendPageProto   `protobuf:"bytes,8,rep,name=frontend_pages,json=frontendPages,proto3" json:"frontend_pages,omitempty"`
	FrontendWidgets    []*FrontendWidgetProto `protobuf:"bytes,9,rep,name=frontend_widgets,json=frontendWidgets,proto3" json:"frontend_widgets,omitempty"`
	SdkVersion         string                 `protobuf:"bytes,10,opt,name=sdk_version,json=sdkVersion,proto3" json:"sdk_version,omitempty"`                         // 插件编译时的 SDK 版本
	Dependencies       []string               `protobuf:"bytes,11,rep,name=dependencies,proto3" json:"dependencies,omitempty"`                                       // 依赖的其他插件 ID
	ConfigSchema       []*ConfigFieldProto    `protobuf:"bytes,12,rep,name=config_schema,json=configSchema,proto3" json:"config_schema,omitempty"`                   // 配置项声明
	InstructionPresets []string               `protobuf:"bytes,13,rep,name=instruction_presets,json=instructionPresets,proto3" json:"instruction_presets,omitempty"` // 可用的 instructions 预设名称列表
	// capabilities 声明的 HostService / Middleware 能力。Core 启动时按
	// "插件类型 → 允许集合" 做交集,gRPC interceptor 按此 set 做准入校验。
	// SDK 版本 <= 0.2.x 的插件豁免(兼容存量),0.3.x 起强制。详见 ADR-0001 Decision 4。
	Capabilities []string `protobuf:"bytes,14,rep,name=capabilities,proto3" json:"capabilities,omitempty"`
	// priority 中间件链中的排序权重(数值越小越早进 Begin、越晚出 End)。
	// 仅 type="middleware" 插件使用;其他类型忽略。默认 100。
	Priority int32 `protobuf:"varint,15,opt,name=priority,proto3" json:"priority,omitempty"`
	// contains filtered or unexported fields
}

func (*PluginInfoResponse) Descriptor deprecated

func (*PluginInfoResponse) Descriptor() ([]byte, []int)

Deprecated: Use PluginInfoResponse.ProtoReflect.Descriptor instead.

func (*PluginInfoResponse) GetAccountTypes

func (x *PluginInfoResponse) GetAccountTypes() []*AccountTypeProto

func (*PluginInfoResponse) GetAuthor

func (x *PluginInfoResponse) GetAuthor() string

func (*PluginInfoResponse) GetCapabilities

func (x *PluginInfoResponse) GetCapabilities() []string

func (*PluginInfoResponse) GetConfigSchema

func (x *PluginInfoResponse) GetConfigSchema() []*ConfigFieldProto

func (*PluginInfoResponse) GetDependencies

func (x *PluginInfoResponse) GetDependencies() []string

func (*PluginInfoResponse) GetDescription

func (x *PluginInfoResponse) GetDescription() string

func (*PluginInfoResponse) GetFrontendPages

func (x *PluginInfoResponse) GetFrontendPages() []*FrontendPageProto

func (*PluginInfoResponse) GetFrontendWidgets

func (x *PluginInfoResponse) GetFrontendWidgets() []*FrontendWidgetProto

func (*PluginInfoResponse) GetId

func (x *PluginInfoResponse) GetId() string

func (*PluginInfoResponse) GetInstructionPresets

func (x *PluginInfoResponse) GetInstructionPresets() []string

func (*PluginInfoResponse) GetName

func (x *PluginInfoResponse) GetName() string

func (*PluginInfoResponse) GetPriority

func (x *PluginInfoResponse) GetPriority() int32

func (*PluginInfoResponse) GetSdkVersion

func (x *PluginInfoResponse) GetSdkVersion() string

func (*PluginInfoResponse) GetType

func (x *PluginInfoResponse) GetType() string

func (*PluginInfoResponse) GetVersion

func (x *PluginInfoResponse) GetVersion() string

func (*PluginInfoResponse) ProtoMessage

func (*PluginInfoResponse) ProtoMessage()

func (*PluginInfoResponse) ProtoReflect

func (x *PluginInfoResponse) ProtoReflect() protoreflect.Message

func (*PluginInfoResponse) Reset

func (x *PluginInfoResponse) Reset()

func (*PluginInfoResponse) String

func (x *PluginInfoResponse) String() string

type PluginServiceClient

type PluginServiceClient interface {
	GetInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*PluginInfoResponse, error)
	Init(ctx context.Context, in *InitRequest, opts ...grpc.CallOption) (*Empty, error)
	Start(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
	Stop(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
	// 获取插件的前端静态资源
	GetWebAssets(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*WebAssetsResponse, error)
	// 健康检查(可选,插件未实现时返回成功)
	HealthCheck(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
	// 通用请求代理:Core 透传,插件自行路由(可选,插件未实现时返回 501)
	HandleRequest(ctx context.Context, in *HttpRequest, opts ...grpc.CallOption) (*HttpResponse, error)
}

PluginServiceClient is the client API for PluginService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type PluginServiceServer

type PluginServiceServer interface {
	GetInfo(context.Context, *Empty) (*PluginInfoResponse, error)
	Init(context.Context, *InitRequest) (*Empty, error)
	Start(context.Context, *Empty) (*Empty, error)
	Stop(context.Context, *Empty) (*Empty, error)
	// 获取插件的前端静态资源
	GetWebAssets(context.Context, *Empty) (*WebAssetsResponse, error)
	// 健康检查(可选,插件未实现时返回成功)
	HealthCheck(context.Context, *Empty) (*Empty, error)
	// 通用请求代理:Core 透传,插件自行路由(可选,插件未实现时返回 501)
	HandleRequest(context.Context, *HttpRequest) (*HttpResponse, error)
	// contains filtered or unexported methods
}

PluginServiceServer is the server API for PluginService service. All implementations must embed UnimplementedPluginServiceServer for forward compatibility.

type QuotaInfoResponse

type QuotaInfoResponse struct {
	Total     float64           `protobuf:"fixed64,1,opt,name=total,proto3" json:"total,omitempty"`
	Used      float64           `protobuf:"fixed64,2,opt,name=used,proto3" json:"used,omitempty"`
	Remaining float64           `protobuf:"fixed64,3,opt,name=remaining,proto3" json:"remaining,omitempty"`
	Currency  string            `protobuf:"bytes,4,opt,name=currency,proto3" json:"currency,omitempty"`
	ExpiresAt string            `protobuf:"bytes,5,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"`
	Extra     map[string]string `` /* 137-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*QuotaInfoResponse) Descriptor deprecated

func (*QuotaInfoResponse) Descriptor() ([]byte, []int)

Deprecated: Use QuotaInfoResponse.ProtoReflect.Descriptor instead.

func (*QuotaInfoResponse) GetCurrency

func (x *QuotaInfoResponse) GetCurrency() string

func (*QuotaInfoResponse) GetExpiresAt

func (x *QuotaInfoResponse) GetExpiresAt() string

func (*QuotaInfoResponse) GetExtra

func (x *QuotaInfoResponse) GetExtra() map[string]string

func (*QuotaInfoResponse) GetRemaining

func (x *QuotaInfoResponse) GetRemaining() float64

func (*QuotaInfoResponse) GetTotal

func (x *QuotaInfoResponse) GetTotal() float64

func (*QuotaInfoResponse) GetUsed

func (x *QuotaInfoResponse) GetUsed() float64

func (*QuotaInfoResponse) ProtoMessage

func (*QuotaInfoResponse) ProtoMessage()

func (*QuotaInfoResponse) ProtoReflect

func (x *QuotaInfoResponse) ProtoReflect() protoreflect.Message

func (*QuotaInfoResponse) Reset

func (x *QuotaInfoResponse) Reset()

func (*QuotaInfoResponse) String

func (x *QuotaInfoResponse) String() string

type RouteDefinitionProto

type RouteDefinitionProto struct {
	Method      string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"`
	Path        string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// contains filtered or unexported fields
}

func (*RouteDefinitionProto) Descriptor deprecated

func (*RouteDefinitionProto) Descriptor() ([]byte, []int)

Deprecated: Use RouteDefinitionProto.ProtoReflect.Descriptor instead.

func (*RouteDefinitionProto) GetDescription

func (x *RouteDefinitionProto) GetDescription() string

func (*RouteDefinitionProto) GetMethod

func (x *RouteDefinitionProto) GetMethod() string

func (*RouteDefinitionProto) GetPath

func (x *RouteDefinitionProto) GetPath() string

func (*RouteDefinitionProto) ProtoMessage

func (*RouteDefinitionProto) ProtoMessage()

func (*RouteDefinitionProto) ProtoReflect

func (x *RouteDefinitionProto) ProtoReflect() protoreflect.Message

func (*RouteDefinitionProto) Reset

func (x *RouteDefinitionProto) Reset()

func (*RouteDefinitionProto) String

func (x *RouteDefinitionProto) String() string

type RoutesResponse

type RoutesResponse struct {
	Routes []*RouteDefinitionProto `protobuf:"bytes,1,rep,name=routes,proto3" json:"routes,omitempty"`
	// contains filtered or unexported fields
}

func (*RoutesResponse) Descriptor deprecated

func (*RoutesResponse) Descriptor() ([]byte, []int)

Deprecated: Use RoutesResponse.ProtoReflect.Descriptor instead.

func (*RoutesResponse) GetRoutes

func (x *RoutesResponse) GetRoutes() []*RouteDefinitionProto

func (*RoutesResponse) ProtoMessage

func (*RoutesResponse) ProtoMessage()

func (*RoutesResponse) ProtoReflect

func (x *RoutesResponse) ProtoReflect() protoreflect.Message

func (*RoutesResponse) Reset

func (x *RoutesResponse) Reset()

func (*RoutesResponse) String

func (x *RoutesResponse) String() string

type RunBackgroundTaskRequest

type RunBackgroundTaskRequest struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*RunBackgroundTaskRequest) Descriptor deprecated

func (*RunBackgroundTaskRequest) Descriptor() ([]byte, []int)

Deprecated: Use RunBackgroundTaskRequest.ProtoReflect.Descriptor instead.

func (*RunBackgroundTaskRequest) GetName

func (x *RunBackgroundTaskRequest) GetName() string

func (*RunBackgroundTaskRequest) ProtoMessage

func (*RunBackgroundTaskRequest) ProtoMessage()

func (*RunBackgroundTaskRequest) ProtoReflect

func (x *RunBackgroundTaskRequest) ProtoReflect() protoreflect.Message

func (*RunBackgroundTaskRequest) Reset

func (x *RunBackgroundTaskRequest) Reset()

func (*RunBackgroundTaskRequest) String

func (x *RunBackgroundTaskRequest) String() string

type StringResponse

type StringResponse struct {
	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*StringResponse) Descriptor deprecated

func (*StringResponse) Descriptor() ([]byte, []int)

Deprecated: Use StringResponse.ProtoReflect.Descriptor instead.

func (*StringResponse) GetValue

func (x *StringResponse) GetValue() string

func (*StringResponse) ProtoMessage

func (*StringResponse) ProtoMessage()

func (*StringResponse) ProtoReflect

func (x *StringResponse) ProtoReflect() protoreflect.Message

func (*StringResponse) Reset

func (x *StringResponse) Reset()

func (*StringResponse) String

func (x *StringResponse) String() string

type UnimplementedExtensionServiceServer

type UnimplementedExtensionServiceServer struct{}

UnimplementedExtensionServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedExtensionServiceServer) GetBackgroundTasks

func (UnimplementedExtensionServiceServer) HandleRequest

func (UnimplementedExtensionServiceServer) HandleStreamRequest

func (UnimplementedExtensionServiceServer) Migrate

func (UnimplementedExtensionServiceServer) RunBackgroundTask

type UnimplementedGatewayServiceServer

type UnimplementedGatewayServiceServer struct{}

UnimplementedGatewayServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedGatewayServiceServer) Forward

func (UnimplementedGatewayServiceServer) ForwardStream

func (UnimplementedGatewayServiceServer) GetModels

func (UnimplementedGatewayServiceServer) GetPlatform

func (UnimplementedGatewayServiceServer) GetRoutes

func (UnimplementedGatewayServiceServer) HandleWebSocket

func (UnimplementedGatewayServiceServer) QueryQuota

func (UnimplementedGatewayServiceServer) ValidateAccount

type UnimplementedHostServiceServer

type UnimplementedHostServiceServer struct{}

UnimplementedHostServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedHostServiceServer) Forward added in v0.1.1

func (UnimplementedHostServiceServer) ForwardStream added in v0.1.1

func (UnimplementedHostServiceServer) GetAssetBytes added in v0.1.3

func (UnimplementedHostServiceServer) GetAssetURL added in v0.1.2

func (UnimplementedHostServiceServer) GetUserInfo added in v0.1.1

func (UnimplementedHostServiceServer) ListGroups

func (UnimplementedHostServiceServer) ListModels added in v0.1.1

func (UnimplementedHostServiceServer) ListPlatforms added in v0.1.1

func (UnimplementedHostServiceServer) ProbeForward

func (UnimplementedHostServiceServer) ReportAccountResult

func (UnimplementedHostServiceServer) StoreAsset added in v0.1.2

type UnimplementedMiddlewareServiceServer

type UnimplementedMiddlewareServiceServer struct{}

UnimplementedMiddlewareServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedMiddlewareServiceServer) OnForwardBegin

func (UnimplementedMiddlewareServiceServer) OnForwardEnd

type UnimplementedPluginServiceServer

type UnimplementedPluginServiceServer struct{}

UnimplementedPluginServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedPluginServiceServer) GetInfo

func (UnimplementedPluginServiceServer) GetWebAssets

func (UnimplementedPluginServiceServer) HandleRequest

func (UnimplementedPluginServiceServer) HealthCheck

func (UnimplementedPluginServiceServer) Init

func (UnimplementedPluginServiceServer) Start

func (UnimplementedPluginServiceServer) Stop

type UnsafeExtensionServiceServer

type UnsafeExtensionServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeExtensionServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ExtensionServiceServer will result in compilation errors.

type UnsafeGatewayServiceServer

type UnsafeGatewayServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeGatewayServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GatewayServiceServer will result in compilation errors.

type UnsafeHostServiceServer

type UnsafeHostServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeHostServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to HostServiceServer will result in compilation errors.

type UnsafeMiddlewareServiceServer

type UnsafeMiddlewareServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeMiddlewareServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to MiddlewareServiceServer will result in compilation errors.

type UnsafePluginServiceServer

type UnsafePluginServiceServer interface {
	// contains filtered or unexported methods
}

UnsafePluginServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PluginServiceServer will result in compilation errors.

type UpstreamResponse

type UpstreamResponse struct {
	StatusCode int32                    `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
	Headers    map[string]*HeaderValues `` /* 141-byte string literal not displayed */
	Body       []byte                   `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

UpstreamResponse 上游返回的原始 HTTP 快照。

func (*UpstreamResponse) Descriptor deprecated

func (*UpstreamResponse) Descriptor() ([]byte, []int)

Deprecated: Use UpstreamResponse.ProtoReflect.Descriptor instead.

func (*UpstreamResponse) GetBody

func (x *UpstreamResponse) GetBody() []byte

func (*UpstreamResponse) GetHeaders

func (x *UpstreamResponse) GetHeaders() map[string]*HeaderValues

func (*UpstreamResponse) GetStatusCode

func (x *UpstreamResponse) GetStatusCode() int32

func (*UpstreamResponse) ProtoMessage

func (*UpstreamResponse) ProtoMessage()

func (*UpstreamResponse) ProtoReflect

func (x *UpstreamResponse) ProtoReflect() protoreflect.Message

func (*UpstreamResponse) Reset

func (x *UpstreamResponse) Reset()

func (*UpstreamResponse) String

func (x *UpstreamResponse) String() string

type Usage

type Usage struct {
	InputTokens            int64   `protobuf:"varint,1,opt,name=input_tokens,json=inputTokens,proto3" json:"input_tokens,omitempty"`
	OutputTokens           int64   `protobuf:"varint,2,opt,name=output_tokens,json=outputTokens,proto3" json:"output_tokens,omitempty"`
	CachedInputTokens      int64   `protobuf:"varint,3,opt,name=cached_input_tokens,json=cachedInputTokens,proto3" json:"cached_input_tokens,omitempty"`
	CacheCreationTokens    int64   `protobuf:"varint,4,opt,name=cache_creation_tokens,json=cacheCreationTokens,proto3" json:"cache_creation_tokens,omitempty"`
	CacheCreation_5MTokens int64   `` /* 129-byte string literal not displayed */
	CacheCreation_1HTokens int64   `` /* 129-byte string literal not displayed */
	ReasoningOutputTokens  int64   `` /* 127-byte string literal not displayed */
	InputCost              float64 `protobuf:"fixed64,10,opt,name=input_cost,json=inputCost,proto3" json:"input_cost,omitempty"`
	OutputCost             float64 `protobuf:"fixed64,11,opt,name=output_cost,json=outputCost,proto3" json:"output_cost,omitempty"`
	CachedInputCost        float64 `protobuf:"fixed64,12,opt,name=cached_input_cost,json=cachedInputCost,proto3" json:"cached_input_cost,omitempty"`
	CacheCreationCost      float64 `protobuf:"fixed64,13,opt,name=cache_creation_cost,json=cacheCreationCost,proto3" json:"cache_creation_cost,omitempty"`
	InputPrice             float64 `protobuf:"fixed64,20,opt,name=input_price,json=inputPrice,proto3" json:"input_price,omitempty"`
	OutputPrice            float64 `protobuf:"fixed64,21,opt,name=output_price,json=outputPrice,proto3" json:"output_price,omitempty"`
	CachedInputPrice       float64 `protobuf:"fixed64,22,opt,name=cached_input_price,json=cachedInputPrice,proto3" json:"cached_input_price,omitempty"`
	CacheCreationPrice     float64 `protobuf:"fixed64,23,opt,name=cache_creation_price,json=cacheCreationPrice,proto3" json:"cache_creation_price,omitempty"`
	CacheCreation_1HPrice  float64 `` /* 128-byte string literal not displayed */
	Model                  string  `protobuf:"bytes,30,opt,name=model,proto3" json:"model,omitempty"`
	ServiceTier            string  `protobuf:"bytes,31,opt,name=service_tier,json=serviceTier,proto3" json:"service_tier,omitempty"`
	FirstTokenMs           int64   `protobuf:"varint,32,opt,name=first_token_ms,json=firstTokenMs,proto3" json:"first_token_ms,omitempty"`
	// image_size 是图像生成请求实际出图的尺寸("WxH",例如 "1024x1024"、"3840x2160")。
	// 网关侧按 1K/2K/4K 三档计费,把分档来源(实际尺寸)记下来,admin 后台 usage_log
	// 显示费用时旁边带上 size,用户能直观看出"为什么这次扣了 0.40"。
	// 非图像请求留空。
	ImageSize string `protobuf:"bytes,33,opt,name=image_size,json=imageSize,proto3" json:"image_size,omitempty"`
	// contains filtered or unexported fields
}

Usage 单次调用的 token / 费用统计。非 Success 判决下应为空。

func (*Usage) Descriptor deprecated

func (*Usage) Descriptor() ([]byte, []int)

Deprecated: Use Usage.ProtoReflect.Descriptor instead.

func (*Usage) GetCacheCreationCost

func (x *Usage) GetCacheCreationCost() float64

func (*Usage) GetCacheCreationPrice

func (x *Usage) GetCacheCreationPrice() float64

func (*Usage) GetCacheCreationTokens

func (x *Usage) GetCacheCreationTokens() int64

func (*Usage) GetCacheCreation_1HPrice

func (x *Usage) GetCacheCreation_1HPrice() float64

func (*Usage) GetCacheCreation_1HTokens

func (x *Usage) GetCacheCreation_1HTokens() int64

func (*Usage) GetCacheCreation_5MTokens

func (x *Usage) GetCacheCreation_5MTokens() int64

func (*Usage) GetCachedInputCost

func (x *Usage) GetCachedInputCost() float64

func (*Usage) GetCachedInputPrice

func (x *Usage) GetCachedInputPrice() float64

func (*Usage) GetCachedInputTokens

func (x *Usage) GetCachedInputTokens() int64

func (*Usage) GetFirstTokenMs

func (x *Usage) GetFirstTokenMs() int64

func (*Usage) GetImageSize added in v0.1.2

func (x *Usage) GetImageSize() string

func (*Usage) GetInputCost

func (x *Usage) GetInputCost() float64

func (*Usage) GetInputPrice

func (x *Usage) GetInputPrice() float64

func (*Usage) GetInputTokens

func (x *Usage) GetInputTokens() int64

func (*Usage) GetModel

func (x *Usage) GetModel() string

func (*Usage) GetOutputCost

func (x *Usage) GetOutputCost() float64

func (*Usage) GetOutputPrice

func (x *Usage) GetOutputPrice() float64

func (*Usage) GetOutputTokens

func (x *Usage) GetOutputTokens() int64

func (*Usage) GetReasoningOutputTokens

func (x *Usage) GetReasoningOutputTokens() int64

func (*Usage) GetServiceTier

func (x *Usage) GetServiceTier() string

func (*Usage) ProtoMessage

func (*Usage) ProtoMessage()

func (*Usage) ProtoReflect

func (x *Usage) ProtoReflect() protoreflect.Message

func (*Usage) Reset

func (x *Usage) Reset()

func (*Usage) String

func (x *Usage) String() string

type WebAssetFile

type WebAssetFile struct {
	Path    string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	Content []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

func (*WebAssetFile) Descriptor deprecated

func (*WebAssetFile) Descriptor() ([]byte, []int)

Deprecated: Use WebAssetFile.ProtoReflect.Descriptor instead.

func (*WebAssetFile) GetContent

func (x *WebAssetFile) GetContent() []byte

func (*WebAssetFile) GetPath

func (x *WebAssetFile) GetPath() string

func (*WebAssetFile) ProtoMessage

func (*WebAssetFile) ProtoMessage()

func (*WebAssetFile) ProtoReflect

func (x *WebAssetFile) ProtoReflect() protoreflect.Message

func (*WebAssetFile) Reset

func (x *WebAssetFile) Reset()

func (*WebAssetFile) String

func (x *WebAssetFile) String() string

type WebAssetsResponse

type WebAssetsResponse struct {
	Files     []*WebAssetFile `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty"`
	HasAssets bool            `protobuf:"varint,2,opt,name=has_assets,json=hasAssets,proto3" json:"has_assets,omitempty"`
	// contains filtered or unexported fields
}

func (*WebAssetsResponse) Descriptor deprecated

func (*WebAssetsResponse) Descriptor() ([]byte, []int)

Deprecated: Use WebAssetsResponse.ProtoReflect.Descriptor instead.

func (*WebAssetsResponse) GetFiles

func (x *WebAssetsResponse) GetFiles() []*WebAssetFile

func (*WebAssetsResponse) GetHasAssets

func (x *WebAssetsResponse) GetHasAssets() bool

func (*WebAssetsResponse) ProtoMessage

func (*WebAssetsResponse) ProtoMessage()

func (*WebAssetsResponse) ProtoReflect

func (x *WebAssetsResponse) ProtoReflect() protoreflect.Message

func (*WebAssetsResponse) Reset

func (x *WebAssetsResponse) Reset()

func (*WebAssetsResponse) String

func (x *WebAssetsResponse) String() string

type WebSocketConnectInfo

type WebSocketConnectInfo struct {
	Path         string                   `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"`
	Query        string                   `protobuf:"bytes,2,opt,name=query,proto3" json:"query,omitempty"`
	Headers      map[string]*HeaderValues `` /* 141-byte string literal not displayed */
	RemoteAddr   string                   `protobuf:"bytes,4,opt,name=remote_addr,json=remoteAddr,proto3" json:"remote_addr,omitempty"`
	ConnectionId string                   `protobuf:"bytes,5,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty"`
	Account      *AccountProto            `protobuf:"bytes,12,opt,name=account,proto3" json:"account,omitempty"`
	// contains filtered or unexported fields
}

func (*WebSocketConnectInfo) Descriptor deprecated

func (*WebSocketConnectInfo) Descriptor() ([]byte, []int)

Deprecated: Use WebSocketConnectInfo.ProtoReflect.Descriptor instead.

func (*WebSocketConnectInfo) GetAccount

func (x *WebSocketConnectInfo) GetAccount() *AccountProto

func (*WebSocketConnectInfo) GetConnectionId

func (x *WebSocketConnectInfo) GetConnectionId() string

func (*WebSocketConnectInfo) GetHeaders

func (x *WebSocketConnectInfo) GetHeaders() map[string]*HeaderValues

func (*WebSocketConnectInfo) GetPath

func (x *WebSocketConnectInfo) GetPath() string

func (*WebSocketConnectInfo) GetQuery

func (x *WebSocketConnectInfo) GetQuery() string

func (*WebSocketConnectInfo) GetRemoteAddr

func (x *WebSocketConnectInfo) GetRemoteAddr() string

func (*WebSocketConnectInfo) ProtoMessage

func (*WebSocketConnectInfo) ProtoMessage()

func (*WebSocketConnectInfo) ProtoReflect

func (x *WebSocketConnectInfo) ProtoReflect() protoreflect.Message

func (*WebSocketConnectInfo) Reset

func (x *WebSocketConnectInfo) Reset()

func (*WebSocketConnectInfo) String

func (x *WebSocketConnectInfo) String() string

type WebSocketFrame

type WebSocketFrame struct {
	Type WebSocketFrame_FrameType `protobuf:"varint,1,opt,name=type,proto3,enum=airgate.plugin.v1.WebSocketFrame_FrameType" json:"type,omitempty"`
	Data []byte                   `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// 仅 CONNECT 帧使用
	ConnectInfo *WebSocketConnectInfo `protobuf:"bytes,3,opt,name=connect_info,json=connectInfo,proto3" json:"connect_info,omitempty"`
	// 仅 CLOSE 帧使用
	CloseCode   int32  `protobuf:"varint,4,opt,name=close_code,json=closeCode,proto3" json:"close_code,omitempty"`
	CloseReason string `protobuf:"bytes,5,opt,name=close_reason,json=closeReason,proto3" json:"close_reason,omitempty"`
	// 仅 RESULT 帧使用
	Outcome *ForwardOutcome `protobuf:"bytes,6,opt,name=outcome,proto3" json:"outcome,omitempty"`
	// contains filtered or unexported fields
}

func (*WebSocketFrame) Descriptor deprecated

func (*WebSocketFrame) Descriptor() ([]byte, []int)

Deprecated: Use WebSocketFrame.ProtoReflect.Descriptor instead.

func (*WebSocketFrame) GetCloseCode

func (x *WebSocketFrame) GetCloseCode() int32

func (*WebSocketFrame) GetCloseReason

func (x *WebSocketFrame) GetCloseReason() string

func (*WebSocketFrame) GetConnectInfo

func (x *WebSocketFrame) GetConnectInfo() *WebSocketConnectInfo

func (*WebSocketFrame) GetData

func (x *WebSocketFrame) GetData() []byte

func (*WebSocketFrame) GetOutcome

func (x *WebSocketFrame) GetOutcome() *ForwardOutcome

func (*WebSocketFrame) GetType

func (*WebSocketFrame) ProtoMessage

func (*WebSocketFrame) ProtoMessage()

func (*WebSocketFrame) ProtoReflect

func (x *WebSocketFrame) ProtoReflect() protoreflect.Message

func (*WebSocketFrame) Reset

func (x *WebSocketFrame) Reset()

func (*WebSocketFrame) String

func (x *WebSocketFrame) String() string

type WebSocketFrame_FrameType

type WebSocketFrame_FrameType int32
const (
	WebSocketFrame_CONNECT WebSocketFrame_FrameType = 0 // 连接建立,携带元信息(仅第一帧)
	WebSocketFrame_TEXT    WebSocketFrame_FrameType = 1 // 文本消息
	WebSocketFrame_BINARY  WebSocketFrame_FrameType = 2 // 二进制消息
	WebSocketFrame_CLOSE   WebSocketFrame_FrameType = 3 // 关闭连接
	WebSocketFrame_RESULT  WebSocketFrame_FrameType = 4 // 连接结束,携带 ForwardResult
)

func (WebSocketFrame_FrameType) Descriptor

func (WebSocketFrame_FrameType) Enum

func (WebSocketFrame_FrameType) EnumDescriptor deprecated

func (WebSocketFrame_FrameType) EnumDescriptor() ([]byte, []int)

Deprecated: Use WebSocketFrame_FrameType.Descriptor instead.

func (WebSocketFrame_FrameType) Number

func (WebSocketFrame_FrameType) String

func (x WebSocketFrame_FrameType) String() string

func (WebSocketFrame_FrameType) Type

Jump to

Keyboard shortcuts

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