plugins

package
v0.0.0-...-171f680 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const PluginServicePluginAPIVersion = 1

Variables

View Source
var (
	ErrInvalidLength        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflow          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group")
)

Functions

func WazeroModuleConfig

func WazeroModuleConfig(moduleConfig wazero.ModuleConfig) wazeroConfigOption

func WazeroRuntime

func WazeroRuntime(newRuntime WazeroNewRuntime) wazeroConfigOption

Types

type DeviceInfo

type DeviceInfo struct {
	DeviceId   string `protobuf:"bytes,1,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"`
	DeviceName string `protobuf:"bytes,2,opt,name=device_name,json=deviceName,proto3" json:"device_name,omitempty"`
	DeviceType string `protobuf:"bytes,3,opt,name=device_type,json=deviceType,proto3" json:"device_type,omitempty"` // 如 "speaker", "phone", "tablet" 等
	// contains filtered or unexported fields
}

设备信息

func (*DeviceInfo) GetDeviceId

func (x *DeviceInfo) GetDeviceId() string

func (*DeviceInfo) GetDeviceName

func (x *DeviceInfo) GetDeviceName() string

func (*DeviceInfo) GetDeviceType

func (x *DeviceInfo) GetDeviceType() string

func (*DeviceInfo) MarshalToSizedBufferVT

func (m *DeviceInfo) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*DeviceInfo) MarshalToVT

func (m *DeviceInfo) MarshalToVT(dAtA []byte) (int, error)

func (*DeviceInfo) MarshalVT

func (m *DeviceInfo) MarshalVT() (dAtA []byte, err error)

func (*DeviceInfo) ProtoReflect

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

func (*DeviceInfo) SizeVT

func (m *DeviceInfo) SizeVT() (n int)

func (*DeviceInfo) UnmarshalVT

func (m *DeviceInfo) UnmarshalVT(dAtA []byte) error

type DeviceLoginRequest

type DeviceLoginRequest struct {

	// Types that are assignable to AuthType:
	//
	//	*DeviceLoginRequest_UsernamePassword
	//	*DeviceLoginRequest_TokenAuth
	//	*DeviceLoginRequest_Oauth
	AuthType isDeviceLoginRequest_AuthType `protobuf_oneof:"auth_type"`
	// contains filtered or unexported fields
}

设备登录请求

func (*DeviceLoginRequest) GetAuthType

func (m *DeviceLoginRequest) GetAuthType() isDeviceLoginRequest_AuthType

func (*DeviceLoginRequest) GetOauth

func (x *DeviceLoginRequest) GetOauth() *OAuthAuth

func (*DeviceLoginRequest) GetTokenAuth

func (x *DeviceLoginRequest) GetTokenAuth() *TokenAuth

func (*DeviceLoginRequest) GetUsernamePassword

func (x *DeviceLoginRequest) GetUsernamePassword() *UsernamePasswordAuth

func (*DeviceLoginRequest) MarshalToSizedBufferVT

func (m *DeviceLoginRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*DeviceLoginRequest) MarshalToVT

func (m *DeviceLoginRequest) MarshalToVT(dAtA []byte) (int, error)

func (*DeviceLoginRequest) MarshalVT

func (m *DeviceLoginRequest) MarshalVT() (dAtA []byte, err error)

func (*DeviceLoginRequest) ProtoReflect

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

func (*DeviceLoginRequest) SizeVT

func (m *DeviceLoginRequest) SizeVT() (n int)

func (*DeviceLoginRequest) UnmarshalVT

func (m *DeviceLoginRequest) UnmarshalVT(dAtA []byte) error

type DeviceLoginRequest_Oauth

type DeviceLoginRequest_Oauth struct {
	// OAuth认证
	Oauth *OAuthAuth `protobuf:"bytes,3,opt,name=oauth,proto3,oneof"`
}

func (*DeviceLoginRequest_Oauth) MarshalToSizedBufferVT

func (m *DeviceLoginRequest_Oauth) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*DeviceLoginRequest_Oauth) MarshalToVT

func (m *DeviceLoginRequest_Oauth) MarshalToVT(dAtA []byte) (int, error)

func (*DeviceLoginRequest_Oauth) SizeVT

func (m *DeviceLoginRequest_Oauth) SizeVT() (n int)

type DeviceLoginRequest_TokenAuth

type DeviceLoginRequest_TokenAuth struct {
	// Token认证
	TokenAuth *TokenAuth `protobuf:"bytes,2,opt,name=token_auth,json=tokenAuth,proto3,oneof"`
}

func (*DeviceLoginRequest_TokenAuth) MarshalToSizedBufferVT

func (m *DeviceLoginRequest_TokenAuth) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*DeviceLoginRequest_TokenAuth) MarshalToVT

func (m *DeviceLoginRequest_TokenAuth) MarshalToVT(dAtA []byte) (int, error)

func (*DeviceLoginRequest_TokenAuth) SizeVT

func (m *DeviceLoginRequest_TokenAuth) SizeVT() (n int)

type DeviceLoginRequest_UsernamePassword

type DeviceLoginRequest_UsernamePassword struct {
	// 账号密码认证
	UsernamePassword *UsernamePasswordAuth `protobuf:"bytes,1,opt,name=username_password,json=usernamePassword,proto3,oneof"`
}

func (*DeviceLoginRequest_UsernamePassword) MarshalToSizedBufferVT

func (m *DeviceLoginRequest_UsernamePassword) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*DeviceLoginRequest_UsernamePassword) MarshalToVT

func (m *DeviceLoginRequest_UsernamePassword) MarshalToVT(dAtA []byte) (int, error)

func (*DeviceLoginRequest_UsernamePassword) SizeVT

func (m *DeviceLoginRequest_UsernamePassword) SizeVT() (n int)

type DeviceLoginResponse

type DeviceLoginResponse struct {
	Success bool          `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	Message string        `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	Devices []*DeviceInfo `protobuf:"bytes,3,rep,name=devices,proto3" json:"devices,omitempty"` // 登录成功后返回设备列表
	// contains filtered or unexported fields
}

设备登录响应

func (*DeviceLoginResponse) GetDevices

func (x *DeviceLoginResponse) GetDevices() []*DeviceInfo

func (*DeviceLoginResponse) GetMessage

func (x *DeviceLoginResponse) GetMessage() string

func (*DeviceLoginResponse) GetSuccess

func (x *DeviceLoginResponse) GetSuccess() bool

func (*DeviceLoginResponse) MarshalToSizedBufferVT

func (m *DeviceLoginResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*DeviceLoginResponse) MarshalToVT

func (m *DeviceLoginResponse) MarshalToVT(dAtA []byte) (int, error)

func (*DeviceLoginResponse) MarshalVT

func (m *DeviceLoginResponse) MarshalVT() (dAtA []byte, err error)

func (*DeviceLoginResponse) ProtoReflect

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

func (*DeviceLoginResponse) SizeVT

func (m *DeviceLoginResponse) SizeVT() (n int)

func (*DeviceLoginResponse) UnmarshalVT

func (m *DeviceLoginResponse) UnmarshalVT(dAtA []byte) error

type DevicePlayRequest

type DevicePlayRequest struct {
	DeviceId string `protobuf:"bytes,1,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"`
	MusicUrl string `protobuf:"bytes,2,opt,name=music_url,json=musicUrl,proto3" json:"music_url,omitempty"`
	// contains filtered or unexported fields
}

设备播放请求

func (*DevicePlayRequest) GetDeviceId

func (x *DevicePlayRequest) GetDeviceId() string

func (*DevicePlayRequest) GetMusicUrl

func (x *DevicePlayRequest) GetMusicUrl() string

func (*DevicePlayRequest) MarshalToSizedBufferVT

func (m *DevicePlayRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*DevicePlayRequest) MarshalToVT

func (m *DevicePlayRequest) MarshalToVT(dAtA []byte) (int, error)

func (*DevicePlayRequest) MarshalVT

func (m *DevicePlayRequest) MarshalVT() (dAtA []byte, err error)

func (*DevicePlayRequest) ProtoReflect

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

func (*DevicePlayRequest) SizeVT

func (m *DevicePlayRequest) SizeVT() (n int)

func (*DevicePlayRequest) UnmarshalVT

func (m *DevicePlayRequest) UnmarshalVT(dAtA []byte) error

type DevicePlayResponse

type DevicePlayResponse struct {
	Success bool   `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

设备播放响应

func (*DevicePlayResponse) GetMessage

func (x *DevicePlayResponse) GetMessage() string

func (*DevicePlayResponse) GetSuccess

func (x *DevicePlayResponse) GetSuccess() bool

func (*DevicePlayResponse) MarshalToSizedBufferVT

func (m *DevicePlayResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*DevicePlayResponse) MarshalToVT

func (m *DevicePlayResponse) MarshalToVT(dAtA []byte) (int, error)

func (*DevicePlayResponse) MarshalVT

func (m *DevicePlayResponse) MarshalVT() (dAtA []byte, err error)

func (*DevicePlayResponse) ProtoReflect

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

func (*DevicePlayResponse) SizeVT

func (m *DevicePlayResponse) SizeVT() (n int)

func (*DevicePlayResponse) UnmarshalVT

func (m *DevicePlayResponse) UnmarshalVT(dAtA []byte) error

type OAuthAuth

type OAuthAuth struct {
	AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
	Provider    string `protobuf:"bytes,2,opt,name=provider,proto3" json:"provider,omitempty"` // 如 "google", "facebook" 等
	// contains filtered or unexported fields
}

OAuth认证

func (*OAuthAuth) GetAccessToken

func (x *OAuthAuth) GetAccessToken() string

func (*OAuthAuth) GetProvider

func (x *OAuthAuth) GetProvider() string

func (*OAuthAuth) MarshalToSizedBufferVT

func (m *OAuthAuth) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*OAuthAuth) MarshalToVT

func (m *OAuthAuth) MarshalToVT(dAtA []byte) (int, error)

func (*OAuthAuth) MarshalVT

func (m *OAuthAuth) MarshalVT() (dAtA []byte, err error)

func (*OAuthAuth) ProtoReflect

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

func (*OAuthAuth) SizeVT

func (m *OAuthAuth) SizeVT() (n int)

func (*OAuthAuth) UnmarshalVT

func (m *OAuthAuth) UnmarshalVT(dAtA []byte) error

type PluginService

type PluginService interface {
	// 设备登录
	DeviceLogin(context.Context, *DeviceLoginRequest) (*DeviceLoginResponse, error)
	// 设备播放
	DevicePlay(context.Context, *DevicePlayRequest) (*DevicePlayResponse, error)
}

插件服务定义 go:plugin type=plugin version=1

type PluginServicePlugin

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

func NewPluginServicePlugin

func NewPluginServicePlugin(ctx context.Context, opts ...wazeroConfigOption) (*PluginServicePlugin, error)

func (*PluginServicePlugin) Load

func (p *PluginServicePlugin) Load(ctx context.Context, pluginPath string) (pluginService, error)

type TokenAuth

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

Token认证

func (*TokenAuth) GetToken

func (x *TokenAuth) GetToken() string

func (*TokenAuth) MarshalToSizedBufferVT

func (m *TokenAuth) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*TokenAuth) MarshalToVT

func (m *TokenAuth) MarshalToVT(dAtA []byte) (int, error)

func (*TokenAuth) MarshalVT

func (m *TokenAuth) MarshalVT() (dAtA []byte, err error)

func (*TokenAuth) ProtoReflect

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

func (*TokenAuth) SizeVT

func (m *TokenAuth) SizeVT() (n int)

func (*TokenAuth) UnmarshalVT

func (m *TokenAuth) UnmarshalVT(dAtA []byte) error

type UsernamePasswordAuth

type UsernamePasswordAuth struct {
	Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

账号密码认证

func (*UsernamePasswordAuth) GetPassword

func (x *UsernamePasswordAuth) GetPassword() string

func (*UsernamePasswordAuth) GetUsername

func (x *UsernamePasswordAuth) GetUsername() string

func (*UsernamePasswordAuth) MarshalToSizedBufferVT

func (m *UsernamePasswordAuth) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*UsernamePasswordAuth) MarshalToVT

func (m *UsernamePasswordAuth) MarshalToVT(dAtA []byte) (int, error)

func (*UsernamePasswordAuth) MarshalVT

func (m *UsernamePasswordAuth) MarshalVT() (dAtA []byte, err error)

func (*UsernamePasswordAuth) ProtoReflect

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

func (*UsernamePasswordAuth) SizeVT

func (m *UsernamePasswordAuth) SizeVT() (n int)

func (*UsernamePasswordAuth) UnmarshalVT

func (m *UsernamePasswordAuth) UnmarshalVT(dAtA []byte) error

type WazeroConfig

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

type WazeroNewRuntime

type WazeroNewRuntime func(context.Context) (wazero.Runtime, error)

func DefaultWazeroRuntime

func DefaultWazeroRuntime() WazeroNewRuntime

Jump to

Keyboard shortcuts

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