2026-03-28 18:44:34 +03:00

53 lines
1.1 KiB
Go

// Code generated by kitcom. DO NOT EDIT.
package main
import (
"encoding/base64"
"fmt"
kittenipc "github.com/egor3f/kitten-ipc"
)
var _ = base64.StdEncoding
type TsIpcApi struct {
Ipc kittenipc.IpcCommon
}
func (t *TsIpcApi) Div(
a int, b int,
) (
int, error,
) {
results, err := t.Ipc.Call("TsIpcApi.Div", a, b)
if err != nil {
return 0, fmt.Errorf("call to TsIpcApi.Div failed: %w", err)
}
if len(results) < 1 {
return 0, fmt.Errorf("call to TsIpcApi.Div: expected 1 results, got %d", len(results))
}
return int(results[0].(float64)), nil
}
func (t *TsIpcApi) XorData(
data1 []byte, data2 []byte,
) (
[]byte, error,
) {
results, err := t.Ipc.Call("TsIpcApi.XorData", data1, data2)
if err != nil {
return []byte{}, fmt.Errorf("call to TsIpcApi.XorData failed: %w", err)
}
if len(results) < 1 {
return []byte{}, fmt.Errorf("call to TsIpcApi.XorData: expected 1 results, got %d", len(results))
}
results[0], err = base64.StdEncoding.DecodeString(results[0].(string))
if err != nil {
return []byte{}, fmt.Errorf("call to TsIpcApi.XorData: error decoding blob: %w", err)
}
return results[0].([]byte), nil
}