text:
package goutils

import (
	"fmt"
	"image"
	"image/jpeg"
	"os"

	"github.com/oliamb/cutter"
)

// ImageMetadata contains width and height of an image
type ImageMetadata struct {
	Width  int
	Height int
}

// TestImage extends image.Image
type TestImage struct {
	image.Image
	ImageMetadata
}

// Image interface for images
type Image interface {
	Save() func(string) error
	CropNumbers() func() (image.Image, error)
	CropAndSave() func(string) error
}

func getMetadata(i image.Image) ImageMetadata {
	var mdata ImageMetadata
	bounds := i.Bounds()
	mdata.Width = bounds.Dx()
	mdata.Height = bounds.Dy()
	return mdata
}

// GetImage returns your image and its metadata
func GetImage(filename string) (*TestImage, error) {
	mdata := ImageMetadata{}
	// Read image from file that already exists
	existingImageFile, err := os.Open(filename)
	if err != nil {
		return nil, err
	}
	defer existingImageFile.Close()

	loadedImage, err := jpeg.Decode(existingImageFile)
	if err != nil {
		return nil, err
	}
	mdata = getMetadata(loadedImage)
	img := &TestImage{loadedImage, mdata}
	return img, nil
}

func saveImage(filename string, i image.Image) error {
	file, err := os.Create(filename)
	if err != nil {
		fmt.Println(err.Error())
		return err
	}
	jpeg.Encode(file, i, nil)
	return nil
}

// Save saves the image to given filename output
func (i TestImage) Save(filename string) error {
	return saveImage(filename, i)
}

// CropAndSave crops and saves to system using cutter
func (i *TestImage) CropAndSave(filename string, config cutter.Config) error {
	config.Options = cutter.Copy

	img, err := cutter.Crop(i, config)
	if err != nil {
		return err
	}
	return saveImage(filename, img)
}

// Crop crops and returns the new part
func (i *TestImage) Crop(config cutter.Config) (TestImage, error) {
	config.Options = cutter.Copy

	img, err := cutter.Crop(i, config)
	if err != nil {
		return TestImage{}, err
	}
	ni := TestImage{img, getMetadata(img)}
	return ni, nil
}

// RemoveBlank removes the blank part from the bottom of test image and saves to system by overriding original
func (i *TestImage) RemoveBlank(filename string) error {
	pixels, err := GetPixels(i)
	if err != nil {
		return err
	}

	firstI := -1
	notWhite := 0

	for i := len(pixels) - 1; i >= 0; i-- {
		row := pixels[i]
		if notWhite > len(pixels[0])*4/100 {
			// fmt.Println(firstI)
			break
		} else if firstI-i >= 10 {
			firstI = -1
		}
		for _, p := range row {
			if checkDarkness(p) {
				notWhite++
				if firstI == -1 {
					firstI = i
				}
			}
		}
	}

	config := cutter.Config{Width: i.Width, Height: firstI + 20}
	im, err := cutter.Crop(i, config)
	saveImage(filename, im)
	return err
}

// DetectStartingPixel detects the starting pixel from left to right
func (i *TestImage) DetectStartingPixel() int {
	pixels, err := GetPixels(i)
	if err != nil {
		return -1
	}

	start := -1
	for i := 0; i < len(pixels[0]); i++ {
		if start != -1 {
			break
		}
		for j := 0; j < len(pixels); j++ {
			p := pixels[j][i]
			if checkDarkness(p) {
				start = i
				break
			}
		}
	}
	return start
}

repository: tolgaerdonmez/goutils

repo_name: tolgaerdonmez/goutils

branch_name: refs/heads/main


text:
package types

import (
	sdk "github.com/okex/okexchain-go-sdk/types"
)

// MsgNewOrders - structure for placing multi-orders
type MsgNewOrders struct {
	Sender     sdk.AccAddress `json:"sender"`
	OrderItems []OrderItem    `json:"order_items"`
}

// NewMsgNewOrders is a constructor function for MsgNewOrders
func NewMsgNewOrders(sender sdk.AccAddress, orderItems []OrderItem) MsgNewOrders {
	return MsgNewOrders{
		Sender:     sender,
		OrderItems: orderItems,
	}
}

// GetSignBytes encodes the message for signing
func (msg MsgNewOrders) GetSignBytes() []byte {
	return sdk.MustSortJSON(msgCdc.MustMarshalJSON(msg))
}

// nolint
func (MsgNewOrders) Route() string                { return "" }
func (MsgNewOrders) Type() string                 { return "" }
func (MsgNewOrders) ValidateBasic() sdk.Error     { return nil }
func (MsgNewOrders) GetSigners() []sdk.AccAddress { return nil }

// MsgCancelOrders - structure for canceling several orders that have been placed
type MsgCancelOrders struct {
	Sender   sdk.AccAddress `json:"sender"`
	OrderIDs []string       `json:"order_ids"`
}

// NewMsgCancelOrders is a constructor function for MsgCancelOrders
func NewMsgCancelOrders(sender sdk.AccAddress, orderIDItems []string) MsgCancelOrders {
	return MsgCancelOrders{
		Sender:   sender,
		OrderIDs: orderIDItems,
	}
}

// GetSignBytes encodes the message for signing
func (msg MsgCancelOrders) GetSignBytes() []byte {
	return sdk.MustSortJSON(msgCdc.MustMarshalJSON(msg))
}

// nolint
func (MsgCancelOrders) Route() string                { return "" }
func (MsgCancelOrders) Type() string                 { return "" }
func (MsgCancelOrders) ValidateBasic() sdk.Error     { return nil }
func (MsgCancelOrders) GetSigners() []sdk.AccAddress { return nil }

repository: RevelationOfTuring/okexchain-go-sdk

license_type: permissive

repo_name: RevelationOfTuring/okexchain-go-sdk

branch_name: refs/heads/master

extension: go


text:
SUMMARY = "Task to install additional miscellaneous packages"
LICENSE = "MIT"
PR = "r0"

inherit packagegroup

RDEPENDS:${PN} = "\
    nano \
    mc \
    rsync \
"

license: MIT

repository: rcn-ee/meta-arago

repo_name: rcn-ee/meta-arago

extension: bb


text:
package config

import (
	"errors"
	"io"
	"os"
	"path/filepath"

	"gopkg.in/yaml.v2"
)

var (
	file = "jrnl.yml"

	PostsDir   = "_posts"
	PagesDir   = "_pages"
	SiteDir    = "_site"
	ThemesDir  = "_themes"
	LayoutsDir = "_layouts"
	IndexDir   = "_index"
	AssetsDir  = filepath.Join(SiteDir, "assets")

	Dirs = []string{
		PostsDir,
		PagesDir,
		SiteDir,
		ThemesDir,
		LayoutsDir,
		AssetsDir,
	}

	DirMode  = os.FileMode(0755)
	FileMode = os.FileMode(0644)
)

type Config struct {
	*os.File `yaml:"-"`

	Title  string
	Site   string
	Author struct {
		Name  string
		Email string
	}
	Description string
	Theme       string
	Remote      string
}

// Check if jrnl has already been initialized in the given directory.
func Initialized(dir string) error {
	for _, f := range Dirs {
		info, err := os.Stat(filepath.Join(dir, f))

		if err != nil {
			return err
		}

		if !info.IsDir() {
			return errors.New("not a directory " + filepath.Join(dir, f))
		}
	}

	return nil
}

// Create the jrnl.yml file in the given directory. This is called during jrnl initialization
// which is why we pass it a directory whereby the jrnl would be initialized.
func Create(dir string) error {
	f, err := os.OpenFile(filepath.Join(dir, file), os.O_CREATE|os.O_RDWR, FileMode)

	if err != nil {
		return err
	}

	defer f.Close()

	cfg := &Config{
		File: f,
	}

	return cfg.Save()
}

// Open the jrnl.yml file.
func Open() (*Config, error) {
	f, err := os.OpenFile(file, os.O_RDWR, FileMode)

	if err != nil {
		return nil, err
	}

	cfg := &Config{
		File: f,
	}

	dec := yaml.NewDecoder(cfg)

	if err := dec.Decode(cfg); err != nil {
		return nil, err
	}

	return cfg, nil
}

// Save the changes made to the jrnl.yml file.
func (c *Config) Save() error {
	info, err := c.Stat()

	if err != nil {
		return err
	}

	if info.Size() > 0 {
		if err := c.Truncate(0); err != nil {
			return err
		}
	}

	if _, err := c.Seek(0, io.SeekStart); err != nil {
		return err
	}

	enc := yaml.NewEncoder(c)

	if err := enc.Encode(c); err != nil {
		return err
	}

	enc.Close()

	return nil
}

repository: shinroo/jrnl

repo_name: shinroo/jrnl


text:
DESCIPTION = "helper tool to use usb dvb frontends"
MAINTAINER = "PLi team"
LICENSE = "GPLv2"

inherit gitpkgv

PV = "1.0+git${SRCPV}"
PKGV = "1.0+git${GITPKGV}"
PR = "r1"

SRC_URI = "git://openpli.git.sourceforge.net/gitroot/openpli/vtuner;protocol=git \
	file://${PN}.sh "

S = "${WORKDIR}/git"

inherit autotools update-rc.d

INITSCRIPT_NAME = "${PN}"
INITSCRIPT_PARAMS = "defaults"

do_install_append() {
	install -d ${D}/etc/init.d
	install -m 0755 ${WORKDIR}/${PN}.sh ${D}/etc/init.d/${PN}
}

gha_language: C


text:
#ifndef __ModuleWindow_H__
#define __ModuleWindow_H__

#include "Module.h"
#include "SDL/include/SDL.h"

class Application;
class ConfigEditor;

class ModuleWindow : public Module
{
public:

	ModuleWindow(Application* app, bool start_enabled = true);

	// Destructor
	virtual ~ModuleWindow();

	bool Init(ConfigEditor* config);
	bool CleanUp();

	void SetTitle(const char* title);

	void ChangeWindowBrightness(float brightness);
	void ChangeWindowWidth(int width);
	void ChangeWindowHeight(int height);

	int GetScreenRefreshRate();
	void GetWinSize(int& x, int& y) const;

	void SetFullscreen(bool fullscreen);
	void SetResizable(bool resizable);
	void SetBorderless(bool borderless);
	void SetFullDesktop(bool full_desktop);

	void Load(ConfigEditor* config);
	void Save(ConfigEditor* config) const;

	void SetDefaultConfig();

	void SetIcon();

public:
	//The window we'll be rendering to
	SDL_Window* window;

	//The surface contained by the window
	SDL_Surface* screen_surface;

	//Config
	bool fullscreen = false;
	bool resizable = false;
	bool borderless = false;
	bool full_desktop = false;
	float brightness = 1.0f;
	int win_width = SCREEN_WIDTH;
	int win_height = SCREEN_HEIGHT;

private:
	SDL_Surface* icon;

};

#endif // __ModuleWindow_H__

repository: ValdiviaDev/Stardust-Engine

path: /Stardust Engine/ModuleWindow.h

repo_name: ValdiviaDev/Stardust-Engine

extension: h


text:
inherit fedora-package
require recipes-fedora/sources/glibc.inc

FILESPATH_append = ":${COREBASE}/meta/recipes-core/glibc/glibc"
require ${COREBASE}/meta/recipes-core/glibc/glibc.inc
require ${COREBASE}/meta/recipes-core/glibc/glibc-version.inc

DEPENDS += "gperf-native bison-native make-native"
RDEPENDS_tzcode = "bash"

NATIVESDKFIXES ?= ""
NATIVESDKFIXES_class-nativesdk = "\
           file://0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch \
           file://0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch \
           file://0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch \
           file://0004-nativesdk-glibc-Allow-64-bit-atomics-for-x86.patch \
           file://0005-nativesdk-glibc-Make-relocatable-install-for-locales.patch \
"

SRC_URI +=  "file://etc/ld.so.conf \
           file://generate-supported.mk \
           file://makedbs.sh \
           \
           ${NATIVESDKFIXES} \
           "

S="${WORKDIR}/glibc-2.29-12-g0941350c20"
B = "${WORKDIR}/build-${TARGET_SYS}"

PACKAGES_DYNAMIC = ""

# the -isystem in bitbake.conf screws up glibc do_stage
BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}"

GLIBC_BROKEN_LOCALES = ""

GLIBCPIE ??= ""

EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
                --disable-profile \
                --disable-debug --without-gd \
                --enable-clocale=gnu \
                --with-headers=${STAGING_INCDIR} \
                --without-selinux \
                --enable-tunables \
                --enable-bind-now \
                --enable-stack-protector=strong \
                --enable-stackguard-randomization \
                --disable-crypt \
                --with-default-link \
                --enable-nscd \
                ${@bb.utils.contains_any('SELECTED_OPTIMIZATION', '-O0 -Og', '--disable-werror', '', d)} \
                ${GLIBCPIE} \
                ${GLIBC_EXTRA_OECONF}"

EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"

do_patch_append() {
    bb.build.exec_func('do_fix_readlib_c', d)
}

do_fix_readlib_c () {
	sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c
}

do_configure () {
# override this function to avoid the autoconf/automake/aclocal/autoheader
# calls for now
# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
# version check and doesn't really help with anything
        (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
        find ${S} -name "configure" | xargs touch
        CPPFLAGS="" oe_runconf
}

do_compile () {
	# -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
	LDFLAGS="-fuse-ld=bfd"
	base_do_compile
	echo "Adjust ldd script"
	if [ -n "${RTLDLIST}" ]
	then
		prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST="\?\([^"]*\)"\?$#\1#'`
		# remove duplicate entries
		newrtld=`echo $(printf '%s\n' ${prevrtld} ${RTLDLIST} | LC_ALL=C sort -u)`
		echo "ldd \"${prevrtld} ${RTLDLIST}\" -> \"${newrtld}\""
		sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${newrtld}\"#"
	fi
}

require ${COREBASE}/meta/recipes-core/glibc/glibc-package.inc

BBCLASSEXTEND = "nativesdk"

gha_language: PHP


text:
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: proto/todo/service.proto

package todo

import (
	context "context"
	fmt "fmt"
	proto "github.com/golang/protobuf/proto"
	timestamp "github.com/golang/protobuf/ptypes/timestamp"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	math "math"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package

type ToDo struct {
	Id                   string               `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Text                 string               `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	Completed            bool                 `protobuf:"varint,3,opt,name=completed,proto3" json:"completed,omitempty"`
	CreatedAt            *timestamp.Timestamp `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	UpdatedAt            *timestamp.Timestamp `protobuf:"bytes,5,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
	XXX_NoUnkeyedLiteral struct{}             `json:"-"`
	XXX_unrecognized     []byte               `json:"-"`
	XXX_sizecache        int32                `json:"-"`
}

func (m *ToDo) Reset()         { *m = ToDo{} }
func (m *ToDo) String() string { return proto.CompactTextString(m) }
func (*ToDo) ProtoMessage()    {}
func (*ToDo) Descriptor() ([]byte, []int) {
	return fileDescriptor_a701854964e7b758, []int{0}
}

func (m *ToDo) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ToDo.Unmarshal(m, b)
}
func (m *ToDo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ToDo.Marshal(b, m, deterministic)
}
func (m *ToDo) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ToDo.Merge(m, src)
}
func (m *ToDo) XXX_Size() int {
	return xxx_messageInfo_ToDo.Size(m)
}
func (m *ToDo) XXX_DiscardUnknown() {
	xxx_messageInfo_ToDo.DiscardUnknown(m)
}

var xxx_messageInfo_ToDo proto.InternalMessageInfo

func (m *ToDo) GetId() string {
	if m != nil {
		return m.Id
	}
	return ""
}

func (m *ToDo) GetText() string {
	if m != nil {
		return m.Text
	}
	return ""
}

func (m *ToDo) GetCompleted() bool {
	if m != nil {
		return m.Completed
	}
	return false
}

func (m *ToDo) GetCreatedAt() *timestamp.Timestamp {
	if m != nil {
		return m.CreatedAt
	}
	return nil
}

func (m *ToDo) GetUpdatedAt() *timestamp.Timestamp {
	if m != nil {
		return m.UpdatedAt
	}
	return nil
}

type ListReq struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *ListReq) Reset()         { *m = ListReq{} }
func (m *ListReq) String() string { return proto.CompactTextString(m) }
func (*ListReq) ProtoMessage()    {}
func (*ListReq) Descriptor() ([]byte, []int) {
	return fileDescriptor_a701854964e7b758, []int{1}
}

func (m *ListReq) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ListReq.Unmarshal(m, b)
}
func (m *ListReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ListReq.Marshal(b, m, deterministic)
}
func (m *ListReq) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ListReq.Merge(m, src)
}
func (m *ListReq) XXX_Size() int {
	return xxx_messageInfo_ListReq.Size(m)
}
func (m *ListReq) XXX_DiscardUnknown() {
	xxx_messageInfo_ListReq.DiscardUnknown(m)
}

var xxx_messageInfo_ListReq proto.InternalMessageInfo

type ListResp struct {
	Items                []*ToDo  `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *ListResp) Reset()         { *m = ListResp{} }
func (m *ListResp) String() string { return proto.CompactTextString(m) }
func (*ListResp) ProtoMessage()    {}
func (*ListResp) Descriptor() ([]byte, []int) {
	return fileDescriptor_a701854964e7b758, []int{2}
}

func (m *ListResp) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ListResp.Unmarshal(m, b)
}
func (m *ListResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ListResp.Marshal(b, m, deterministic)
}
func (m *ListResp) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ListResp.Merge(m, src)
}
func (m *ListResp) XXX_Size() int {
	return xxx_messageInfo_ListResp.Size(m)
}
func (m *ListResp) XXX_DiscardUnknown() {
	xxx_messageInfo_ListResp.DiscardUnknown(m)
}

var xxx_messageInfo_ListResp proto.InternalMessageInfo

func (m *ListResp) GetItems() []*ToDo {
	if m != nil {
		return m.Items
	}
	return nil
}

type GetReq struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *GetReq) Reset()         { *m = GetReq{} }
func (m *GetReq) String() string { return proto.CompactTextString(m) }
func (*GetReq) ProtoMessage()    {}
func (*GetReq) Descriptor() ([]byte, []int) {
	return fileDescriptor_a701854964e7b758, []int{3}
}

func (m *GetReq) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GetReq.Unmarshal(m, b)
}
func (m *GetReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GetReq.Marshal(b, m, deterministic)
}
func (m *GetReq) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GetReq.Merge(m, src)
}
func (m *GetReq) XXX_Size() int {
	return xxx_messageInfo_GetReq.Size(m)
}
func (m *GetReq) XXX_DiscardUnknown() {
	xxx_messageInfo_GetReq.DiscardUnknown(m)
}

var xxx_messageInfo_GetReq proto.InternalMessageInfo

func (m *GetReq) GetId() string {
	if m != nil {
		return m.Id
	}
	return ""
}

type CreateReq struct {
	Text                 string   `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *CreateReq) Reset()         { *m = CreateReq{} }
func (m *CreateReq) String() string { return proto.CompactTextString(m) }
func (*CreateReq) ProtoMessage()    {}
func (*CreateReq) Descriptor() ([]byte, []int) {
	return fileDescriptor_a701854964e7b758, []int{4}
}

func (m *CreateReq) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_CreateReq.Unmarshal(m, b)
}
func (m *CreateReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_CreateReq.Marshal(b, m, deterministic)
}
func (m *CreateReq) XXX_Merge(src proto.Message) {
	xxx_messageInfo_CreateReq.Merge(m, src)
}
func (m *CreateReq) XXX_Size() int {
	return xxx_messageInfo_CreateReq.Size(m)
}
func (m *CreateReq) XXX_DiscardUnknown() {
	xxx_messageInfo_CreateReq.DiscardUnknown(m)
}

var xxx_messageInfo_CreateReq proto.InternalMessageInfo

func (m *CreateReq) GetText() string {
	if m != nil {
		return m.Text
	}
	return ""
}

type UpdateReq struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Text                 string   `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	Completed            bool     `protobuf:"varint,3,opt,name=completed,proto3" json:"completed,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *UpdateReq) Reset()         { *m = UpdateReq{} }
func (m *UpdateReq) String() string { return proto.CompactTextString(m) }
func (*UpdateReq) ProtoMessage()    {}
func (*UpdateReq) Descriptor() ([]byte, []int) {
	return fileDescriptor_a701854964e7b758, []int{5}
}

func (m *UpdateReq) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_UpdateReq.Unmarshal(m, b)
}
func (m *UpdateReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_UpdateReq.Marshal(b, m, deterministic)
}
func (m *UpdateReq) XXX_Merge(src proto.Message) {
	xxx_messageInfo_UpdateReq.Merge(m, src)
}
func (m *UpdateReq) XXX_Size() int {
	return xxx_messageInfo_UpdateReq.Size(m)
}
func (m *UpdateReq) XXX_DiscardUnknown() {
	xxx_messageInfo_UpdateReq.DiscardUnknown(m)
}

var xxx_messageInfo_UpdateReq proto.InternalMessageInfo

func (m *UpdateReq) GetId() string {
	if m != nil {
		return m.Id
	}
	return ""
}

func (m *UpdateReq) GetText() string {
	if m != nil {
		return m.Text
	}
	return ""
}

func (m *UpdateReq) GetCompleted() bool {
	if m != nil {
		return m.Completed
	}
	return false
}

type DeleteReq struct {
	Id                   string   `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *DeleteReq) Reset()         { *m = DeleteReq{} }
func (m *DeleteReq) String() string { return proto.CompactTextString(m) }
func (*DeleteReq) ProtoMessage()    {}
func (*DeleteReq) Descriptor() ([]byte, []int) {
	return fileDescriptor_a701854964e7b758, []int{6}
}

func (m *DeleteReq) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_DeleteReq.Unmarshal(m, b)
}
func (m *DeleteReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_DeleteReq.Marshal(b, m, deterministic)
}
func (m *DeleteReq) XXX_Merge(src proto.Message) {
	xxx_messageInfo_DeleteReq.Merge(m, src)
}
func (m *DeleteReq) XXX_Size() int {
	return xxx_messageInfo_DeleteReq.Size(m)
}
func (m *DeleteReq) XXX_DiscardUnknown() {
	xxx_messageInfo_DeleteReq.DiscardUnknown(m)
}

var xxx_messageInfo_DeleteReq proto.InternalMessageInfo

func (m *DeleteReq) GetId() string {
	if m != nil {
		return m.Id
	}
	return ""
}

type DeleteResp struct {
	Result               bool     `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *DeleteResp) Reset()         { *m = DeleteResp{} }
func (m *DeleteResp) String() string { return proto.CompactTextString(m) }
func (*DeleteResp) ProtoMessage()    {}
func (*DeleteResp) Descriptor() ([]byte, []int) {
	return fileDescriptor_a701854964e7b758, []int{7}
}

func (m *DeleteResp) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_DeleteResp.Unmarshal(m, b)
}
func (m *DeleteResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_DeleteResp.Marshal(b, m, deterministic)
}
func (m *DeleteResp) XXX_Merge(src proto.Message) {
	xxx_messageInfo_DeleteResp.Merge(m, src)
}
func (m *DeleteResp) XXX_Size() int {
	return xxx_messageInfo_DeleteResp.Size(m)
}
func (m *DeleteResp) XXX_DiscardUnknown() {
	xxx_messageInfo_DeleteResp.DiscardUnknown(m)
}

var xxx_messageInfo_DeleteResp proto.InternalMessageInfo

func (m *DeleteResp) GetResult() bool {
	if m != nil {
		return m.Result
	}
	return false
}

func init() {
	proto.RegisterType((*ToDo)(nil), "todo.ToDo")
	proto.RegisterType((*ListReq)(nil), "todo.ListReq")
	proto.RegisterType((*ListResp)(nil), "todo.ListResp")
	proto.RegisterType((*GetReq)(nil), "todo.GetReq")
	proto.RegisterType((*CreateReq)(nil), "todo.CreateReq")
	proto.RegisterType((*UpdateReq)(nil), "todo.UpdateReq")
	proto.RegisterType((*DeleteReq)(nil), "todo.DeleteReq")
	proto.RegisterType((*DeleteResp)(nil), "todo.DeleteResp")
}

func init() { proto.RegisterFile("proto/todo/service.proto", fileDescriptor_a701854964e7b758) }

var fileDescriptor_a701854964e7b758 = []byte{
	// 368 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x41, 0x4b, 0xc3, 0x40,
	0x10, 0x85, 0x9b, 0x36, 0x8d, 0xcd, 0x54, 0xab, 0xec, 0x41, 0x42, 0x14, 0x1a, 0x17, 0xa1, 0x39,
	0x68, 0x02, 0xf5, 0xe4, 0xb1, 0x58, 0xe8, 0x45, 0x2f, 0xb1, 0x9e, 0xa5, 0x6d, 0xc6, 0x12, 0x68,
	0xd8, 0x98, 0x9d, 0x8a, 0xbf, 0xce, 0x1f, 0xe2, 0xaf, 0x91, 0xdd, 0x4d, 0x6a, 0xad, 0x05, 0xf1,
	0x36, 0xfb, 0xe6, 0x0d, 0xbc, 0xf7, 0xb1, 0xe0, 0x15, 0xa5, 0x20, 0x11, 0x93, 0x48, 0x45, 0x2c,
	0xb1, 0x7c, 0xcb, 0x16, 0x18, 0x69, 0x89, 0xd9, 0x4a, 0xf3, 0xfb, 0x4b, 0x21, 0x96, 0x2b, 0x8c,
	0xb5, 0x36, 0x5f, 0xbf, 0xc4, 0x94, 0xe5, 0x28, 0x69, 0x96, 0x17, 0xc6, 0xc6, 0x3f, 0x2c, 0xb0,
	0xa7, 0x62, 0x2c, 0x58, 0x0f, 0x9a, 0x59, 0xea, 0x59, 0x81, 0x15, 0xba, 0x49, 0x33, 0x4b, 0x19,
	0x03, 0x9b, 0xf0, 0x9d, 0xbc, 0xa6, 0x56, 0xf4, 0xcc, 0xce, 0xc1, 0x5d, 0x88, 0xbc, 0x58, 0x21,
	0x61, 0xea, 0xb5, 0x02, 0x2b, 0xec, 0x24, 0xdf, 0x02, 0xbb, 0x05, 0x58, 0x94, 0x38, 0x23, 0x4c,
	0x9f, 0x67, 0xe4, 0xd9, 0x81, 0x15, 0x76, 0x87, 0x7e, 0x64, 0x02, 0x44, 0x75, 0x80, 0x68, 0x5a,
	0x07, 0x48, 0xdc, 0xca, 0x3d, 0x22, 0x75, 0xba, 0x2e, 0xd2, 0xfa, 0xb4, 0xfd, 0xf7, 0x69, 0xe5,
	0x1e, 0x11, 0x77, 0xe1, 0xe0, 0x3e, 0x93, 0x94, 0xe0, 0x2b, 0xbf, 0x82, 0x8e, 0x19, 0x65, 0xc1,
	0x02, 0x68, 0x67, 0x84, 0xb9, 0xf4, 0xac, 0xa0, 0x15, 0x76, 0x87, 0x10, 0x29, 0x1c, 0x91, 0x6a,
	0x9a, 0x98, 0x05, 0xf7, 0xc0, 0x99, 0xa0, 0xba, 0xdb, 0xad, 0xce, 0xfb, 0xe0, 0xde, 0xe9, 0x68,
	0x6a, 0xb9, 0x87, 0x03, 0x7f, 0x00, 0xf7, 0x49, 0x07, 0xd8, 0x73, 0xfd, 0x7f, 0x70, 0xfc, 0x0c,
	0xdc, 0x31, 0xaa, 0x71, 0x5f, 0x98, 0x4b, 0x80, 0x7a, 0x29, 0x0b, 0x76, 0x0a, 0x4e, 0x89, 0x72,
	0xbd, 0x22, 0xed, 0xe8, 0x24, 0xd5, 0x6b, 0xf8, 0x69, 0x41, 0x57, 0x95, 0x7b, 0x34, 0x7f, 0x80,
	0x0d, 0xc0, 0x56, 0x28, 0xd8, 0x91, 0xe9, 0x5d, 0x11, 0xf2, 0x7b, 0xdb, 0x4f, 0x59, 0xf0, 0x06,
	0xbb, 0x80, 0xd6, 0x04, 0x89, 0x1d, 0x9a, 0x85, 0x01, 0xe2, 0x6f, 0xd1, 0xe2, 0x0d, 0x36, 0x00,
	0xc7, 0xe0, 0x60, 0xc7, 0x46, 0xdf, 0xc0, 0xf9, 0x6d, 0x34, 0x58, 0x6a, 0xe3, 0x06, 0xd2, 0x8e,
	0xf1, 0x1a, 0x1c, 0xd3, 0xa9, 0x36, 0x6e, 0xea, 0xfb, 0x27, 0x3f, 0x05, 0x95, 0x71, 0xee, 0xe8,
	0x1f, 0x70, 0xf3, 0x15, 0x00, 0x00, 0xff, 0xff, 0xa2, 0xe9, 0x6f, 0xa5, 0xed, 0x02, 0x00, 0x00,
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// ToDoServiceClient is the client API for ToDoService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type ToDoServiceClient interface {
	List(ctx context.Context, in *ListReq, opts ...grpc.CallOption) (*ListResp, error)
	Get(ctx context.Context, in *GetReq, opts ...grpc.CallOption) (*ToDo, error)
	Create(ctx context.Context, in *CreateReq, opts ...grpc.CallOption) (*ToDo, error)
	Update(ctx context.Context, in *UpdateReq, opts ...grpc.CallOption) (*ToDo, error)
	Delete(ctx context.Context, in *DeleteReq, opts ...grpc.CallOption) (*DeleteResp, error)
}

type toDoServiceClient struct {
	cc *grpc.ClientConn
}

func NewToDoServiceClient(cc *grpc.ClientConn) ToDoServiceClient {
	return &toDoServiceClient{cc}
}

func (c *toDoServiceClient) List(ctx context.Context, in *ListReq, opts ...grpc.CallOption) (*ListResp, error) {
	out := new(ListResp)
	err := c.cc.Invoke(ctx, "/todo.ToDoService/List", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *toDoServiceClient) Get(ctx context.Context, in *GetReq, opts ...grpc.CallOption) (*ToDo, error) {
	out := new(ToDo)
	err := c.cc.Invoke(ctx, "/todo.ToDoService/Get", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *toDoServiceClient) Create(ctx context.Context, in *CreateReq, opts ...grpc.CallOption) (*ToDo, error) {
	out := new(ToDo)
	err := c.cc.Invoke(ctx, "/todo.ToDoService/Create", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *toDoServiceClient) Update(ctx context.Context, in *UpdateReq, opts ...grpc.CallOption) (*ToDo, error) {
	out := new(ToDo)
	err := c.cc.Invoke(ctx, "/todo.ToDoService/Update", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *toDoServiceClient) Delete(ctx context.Context, in *DeleteReq, opts ...grpc.CallOption) (*DeleteResp, error) {
	out := new(DeleteResp)
	err := c.cc.Invoke(ctx, "/todo.ToDoService/Delete", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// ToDoServiceServer is the server API for ToDoService service.
type ToDoServiceServer interface {
	List(context.Context, *ListReq) (*ListResp, error)
	Get(context.Context, *GetReq) (*ToDo, error)
	Create(context.Context, *CreateReq) (*ToDo, error)
	Update(context.Context, *UpdateReq) (*ToDo, error)
	Delete(context.Context, *DeleteReq) (*DeleteResp, error)
}

// UnimplementedToDoServiceServer can be embedded to have forward compatible implementations.
type UnimplementedToDoServiceServer struct {
}

func (*UnimplementedToDoServiceServer) List(ctx context.Context, req *ListReq) (*ListResp, error) {
	return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (*UnimplementedToDoServiceServer) Get(ctx context.Context, req *GetReq) (*ToDo, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (*UnimplementedToDoServiceServer) Create(ctx context.Context, req *CreateReq) (*ToDo, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (*UnimplementedToDoServiceServer) Update(ctx context.Context, req *UpdateReq) (*ToDo, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
}
func (*UnimplementedToDoServiceServer) Delete(ctx context.Context, req *DeleteReq) (*DeleteResp, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}

func RegisterToDoServiceServer(s *grpc.Server, srv ToDoServiceServer) {
	s.RegisterService(&_ToDoService_serviceDesc, srv)
}

func _ToDoService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ToDoServiceServer).List(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/todo.ToDoService/List",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ToDoServiceServer).List(ctx, req.(*ListReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _ToDoService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ToDoServiceServer).Get(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/todo.ToDoService/Get",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ToDoServiceServer).Get(ctx, req.(*GetReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _ToDoService_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ToDoServiceServer).Create(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/todo.ToDoService/Create",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ToDoServiceServer).Create(ctx, req.(*CreateReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _ToDoService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UpdateReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ToDoServiceServer).Update(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/todo.ToDoService/Update",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ToDoServiceServer).Update(ctx, req.(*UpdateReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _ToDoService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ToDoServiceServer).Delete(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/todo.ToDoService/Delete",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ToDoServiceServer).Delete(ctx, req.(*DeleteReq))
	}
	return interceptor(ctx, in, info, handler)
}

var _ToDoService_serviceDesc = grpc.ServiceDesc{
	ServiceName: "todo.ToDoService",
	HandlerType: (*ToDoServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _ToDoService_List_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _ToDoService_Get_Handler,
		},
		{
			MethodName: "Create",
			Handler:    _ToDoService_Create_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _ToDoService_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _ToDoService_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/todo/service.proto",
}

repository: dmitrymomot/grpc-dart-test

repo_name: dmitrymomot/grpc-dart-test


text:
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

DEPENDS = "u-boot-mkimage-native zip-native"

SRC_URI = "file://aml_autoscript.cmd"

inherit deploy

S = "${WORKDIR}"

do_compile() {
	mkimage -A arm64 -O linux -T script -C none -a 0 -e 0 -n "aml_autoscript" -d ${WORKDIR}/aml_autoscript.cmd ${B}/aml_autoscript
	zip ${B}/aml_autoscript.zip ${B}/aml_autoscript
}

do_deploy() {
	install ${B}/aml_autoscript ${DEPLOYDIR}/aml_autoscript
	install ${B}/aml_autoscript.zip ${DEPLOYDIR}/aml_autoscript.zip
}

addtask deploy before do_build after do_compile

branch_name: refs/heads/kirkstone

gha_license_id: MIT

gha_language: BitBake


text:
@InProceedings{bordes10a,
  title = {Towards Understanding Situated Natural Language},
  author = {Antoine Bordes and Nicolas Usunier and Ronan Collobert and Jason Weston},
  pages = {65--72},
  abstract = {We present a general framework and learning algorithm for the task of concept labeling: each word in a given sentence has to be tagged with the unique physical entity (e.g. person, object or location) or abstract concept it refers to. Our method allows both world knowledge and linguistic information to be used during learning and prediction. We show experimentally that we can learn to use world knowledge to resolve ambiguities in language, such as word senses or reference resolution, without the use of handcrafted rules or features.},
  pdf = {http://jmlr.org/proceedings/papers/v9/bordes10a/bordes10a.pdf},
}

repository: mreid/papersite

repo_name: mreid/papersite

gha_language: TeX

extension: bib


text:
package main

import (
	"flag"
	"log"
	"os"
	"time"

	ps "github.com/firepear/petrel/server"
)

// echonosplit is one of the functions we'll use as Responders after
// we instantiate a Server. it's an echo function, with an argmode of
// "blob".
func echonosplit(args []byte) ([]byte, error) {
	return args, nil
}

// telltime, our other Responder, returns the current datetime
func telltime(args []byte) ([]byte, error) {
	return []byte(time.Now().Format(time.RFC3339)), nil
}

///////////////////////////////////////////////////////////////////////////

// msgHandler is a function which we'll launch later on as a
// goroutine. It listens to our Server's Msgr channel, checking for a
// few critical things and logging everything else informationally.
func msgHandler(s *ps.Server, msgchan chan error) {
	keepalive := true

	for keepalive {
		// wait on a Msg to arrive and do a switch based on
		// its status code.
		msg := <-s.Msgr
		switch msg.Code {
		case 599:
			// 599 is "the Server listener socket has
			// died". this means we're not accepting
			// connections anymore. call s.Quit() to clean
			// things up, send the Msg to our main
			// routine, then kill this loop
			s.Quit()
			keepalive = false
			msgchan <- msg
		case 199:
			// 199 is "we've been told to quit", so we
			// want to break out of the loop here as well
			keepalive = false
			msgchan <- msg
		default:
			// anything else we'll log to the console to
			// show what's going on under the hood!
			log.Println(msg)
		}
	}
}

///////////////////////////////////////////////////////////////////////////

func main() {
	// first, handle command line args
	var socket = flag.String("socket", "localhost:60606", "Addr:port to bind the socket to")
	var hkey = flag.String("hmac", "", "HMAC secret key")
	flag.Parse()

	// set up our Petrel instance.  first create a configuration
	c := &ps.Config{Sockname: *socket, Msglvl: "debug"}
	if *hkey != "" {
		c.HMACKey = []byte(*hkey)
	}

	// then instantiate a Server.
	s, err := ps.TCPServer(c)
	if err != nil {
		log.Printf("could not instantiate Server: %s\n", err)
		os.Exit(1)
	}

	// then Register our Responders with the Server
	err = s.Register("echo", echonosplit)
	if err != nil {
		log.Printf("failed to register responder 'echo': %s", err)
		os.Exit(1)
	}
	err = s.Register("time", telltime)
	if err != nil {
		log.Printf("failed to register responder 'echo': %s", err)
		os.Exit(1)
	}
	// now, if a client sends a request starting with "echo", the
	// request will be dispatched to echonosplit. likewise "time"
	// and telltime.
	log.Println("Petrel handler is serving.")

	// the Server is now listening and ready to do work.  it's
	// time to start msgHandler, the event loop we defined
	// earlier. we hand it a channel that it uses to pass
	// important Msgs to the main event loop, which is coming up
	// next.  it's a 'chan error' instead of a 'chan petrel.Msg'
	// because petrel.Msg implements the error interface.
	msgchan := make(chan error, 1)
	go msgHandler(s, msgchan)

	// and here is the main eventloop. it's simply a select on
	// msgchan and sigchan, so that we can handle shutdown
	// cleanly. the work of handling requests is entirely inside
	// Petrel, and requires no application logic or intervention.
	keepalive := true
	for keepalive {
		select {
		case msg := <-msgchan:
			// we've been handed a Msg over msgchan, which
			// means that our Server has shut itself down
			// for some reason. we're going to exit this
			// loop, causing main() to terminate.
			log.Printf("Handler has shut down. Last Msg received was: %s", msg)
			keepalive = false
			break
		case <-s.Sig:
			// we've trapped a signal from the OS. tell
			// our Server to shut down, but don't exit the
			// eventloop because we want to handle the
			// Msgs which will be incoming -- including
			// the one we'll get on msgchan once the
			// Server has finished its work.
			log.Println("OS signal received; shutting down")
			s.Quit()
		}
		// there's no default case in the select, as that
		// would make it nonblocking, which would in turn
		// cause main() to exit immediately.
	}
}

repository: firepear/petrel

repo_name: firepear/petrel


text:
SUMMARY = "Meta-oe ptest packagegroups"

PACKAGE_ARCH = "${MACHINE_ARCH}"
inherit packagegroup

PROVIDES = "${PACKAGES}"
PACKAGES = "\
    packagegroup-meta-oe \
    packagegroup-meta-oe-benchmarks \
    packagegroup-meta-oe-connectivity \
    packagegroup-meta-oe-connectivity-python2 \
    packagegroup-meta-oe-core \
    packagegroup-meta-oe-crypto \
    packagegroup-meta-oe-bsp \
    packagegroup-meta-oe-dbs \
    packagegroup-meta-oe-dbs-python2 \
    packagegroup-meta-oe-devtools \
    packagegroup-meta-oe-extended \
    packagegroup-meta-oe-extended-python2 \
    packagegroup-meta-oe-kernel \
    packagegroup-meta-oe-multimedia \
    packagegroup-meta-oe-navigation \
    packagegroup-meta-oe-printing \
    packagegroup-meta-oe-shells \
    packagegroup-meta-oe-security \
    packagegroup-meta-oe-support \
    packagegroup-meta-oe-support-python2 \
    packagegroup-meta-oe-test \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "packagegroup-meta-oe-gnome", "", d)} \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "packagegroup-meta-oe-graphics", "", d)} \
    ${@bb.utils.contains("DISTRO_FEATURES", "ptest", "packagegroup-meta-oe-ptest-packages", "", d)} \
"
#PACKAGES += "packagegroup-meta-oe-fortran-packages"

RDEPENDS:packagegroup-meta-oe = "\
    packagegroup-meta-oe-benchmarks \
    packagegroup-meta-oe-bsp \
    packagegroup-meta-oe-connectivity \
    ${@bb.utils.contains("BBFILE_COLLECTIONS", "meta-python2", "packagegroup-meta-oe-connectivity-python2", "", d)} \
    packagegroup-meta-oe-core \
    packagegroup-meta-oe-crypto \
    packagegroup-meta-oe-dbs \
    ${@bb.utils.contains("BBFILE_COLLECTIONS", "meta-python2", "packagegroup-meta-oe-dbs-python2", "", d)} \
    packagegroup-meta-oe-devtools \
    packagegroup-meta-oe-extended \
    ${@bb.utils.contains("BBFILE_COLLECTIONS", "meta-python2", "packagegroup-meta-oe-extended-python2", "", d)} \
    packagegroup-meta-oe-kernel \
    packagegroup-meta-oe-multimedia \
    packagegroup-meta-oe-navigation \
    packagegroup-meta-oe-printing \
    packagegroup-meta-oe-security \
    packagegroup-meta-oe-shells \
    packagegroup-meta-oe-support \
    ${@bb.utils.contains("BBFILE_COLLECTIONS", "meta-python2", "packagegroup-meta-oe-support-python2", "", d)} \
    packagegroup-meta-oe-test \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "packagegroup-meta-oe-gnome", "", d)} \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "packagegroup-meta-oe-graphics", "", d)} \
    ${@bb.utils.contains("DISTRO_FEATURES", "ptest", "packagegroup-meta-oe-ptest-packages", "", d)} \
"

RDEPENDS:packagegroup-meta-oe-benchmarks = "\
    bonnie++ \
    dbench \
    dhrystone \
    fio \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11 wayland opengl", "glmark2", "", d)} \
    iozone3 \
    iperf2 \
    iperf3 \
    libc-bench \
    linpack \
    lmbench \
    mbw \
    memtester \
    nbench-byte \
    phoronix-test-suite \
    qperf \
    s-suite \
    stressapptest \
    tinymembench \
    tiobench \
    whetstone \
"
RDEPENDS:packagegroup-meta-oe-benchmarks:append:armv7a = " cpuburn-arm sysbench"
RDEPENDS:packagegroup-meta-oe-benchmarks:append:armv7ve = " cpuburn-arm sysbench"
RDEPENDS:packagegroup-meta-oe-benchmarks:append:aarch64 = " cpuburn-arm sysbench"
RDEPENDS:packagegroup-meta-oe-benchmarks:append:x86 = " sysbench"
RDEPENDS:packagegroup-meta-oe-benchmarks:append:x86-64 = " sysbench"
RDEPENDS:packagegroup-meta-oe-benchmarks:append:mips = " sysbench"

RDEPENDS:packagegroup-meta-oe-benchmarks:remove:mipsarch = "libhugetlbfs"
RDEPENDS:packagegroup-meta-oe-benchmarks:remove:mips64 = "tinymembench"
RDEPENDS:packagegroup-meta-oe-benchmarks:remove:mips64el = "tinymembench"
RDEPENDS:packagegroup-meta-oe-benchmarks:remove:riscv64 = "libhugetlbfs"
RDEPENDS:packagegroup-meta-oe-benchmarks:remove:riscv32 = "libhugetlbfs"

RDEPENDS:packagegroup-meta-oe-bsp ="\
    acpitool \
    cpufrequtils \
    edac-utils \
    ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "firmwared", "", d)} \
    flashrom \
    fwupd \
    fwupd-efi \
    irda-utils \
    lmsensors-config-cgi \
    lmsensors-config-fancontrol \
    lmsensors-config-sensord \
    lmsensors \
    lsscsi \
    nvme-cli \
    pcmciautils \
    pointercal \
"
RDEPENDS:packagegroup-meta-oe-bsp:append:x86 = " ledmon"
RDEPENDS:packagegroup-meta-oe-bsp:append:x86-64 = " ledmon"

RDEPENDS:packagegroup-meta-oe-bsp:remove:libc-musl = "ledmon"
RDEPENDS:packagegroup-meta-oe-bsp:remove:mipsarch = "efivar efibootmgr fwupd fwupd-efi"
RDEPENDS:packagegroup-meta-oe-bsp:remove:powerpc = "efivar efibootmgr fwupd fwupd-efi"
RDEPENDS:packagegroup-meta-oe-bsp:remove:powerpc64 = "efivar efibootmgr fwupd fwupd-efi"
RDEPENDS:packagegroup-meta-oe-bsp:remove:powerpc64le = "efivar efibootmgr fwupd fwupd-efi"
RDEPENDS:packagegroup-meta-oe-bsp:remove:riscv64 = "efivar efibootmgr fwupd fwupd-efi"
RDEPENDS:packagegroup-meta-oe-bsp:remove:riscv32 = "efivar efibootmgr fwupd fwupd-efi"

RDEPENDS:packagegroup-meta-oe-connectivity ="\
    cyrus-sasl \
    gammu \
    gattlib \
    gensio \
    hostapd \
    ifplugd \
    irssi \
    iwd \
    krb5 \
    libev \
    libimobiledevice \
    libmbim \
    libmtp \
    libndp \
    libnet \
    libqmi \
    libtorrent \
    libuv \
    libwebsockets \
    linuxptp \
    loudmouth \
    modemmanager \
    mosh \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "obex-data-server", "", d)} \
    openobex \
    obexftp \
    packagegroup-tools-bluetooth \
    paho-mqtt-c \
    paho-mqtt-cpp \
    rabbitmq-c \
    rfkill \
    rtorrent \
    ser2net \
    smstools3 \
    telepathy-glib \
    thrift \
    usbmuxd \
    wifi-test-suite \
    zabbix \
    czmq \
    zeromq \
"

RDEPENDS:packagegroup-meta-oe-connectivity:append:libc-glibc = " wvstreams wvdial"

RDEPENDS:packagegroup-meta-oe-connectivity-python2 = "\
    ${@bb.utils.contains("BBFILE_COLLECTIONS", "meta-python2", "telepathy-idle", "", d)} \
"

# dracut needs dracut
RDEPENDS:packagegroup-meta-oe-core = "\
    ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "dbus-broker", "", d)} \
    dbus-daemon-proxy \
    libdbus-c++ \
    emlog \
    kernel-module-emlog \
    glibmm \
    libnfc \
    libsigc++-2.0 \
    libsigc++-3 \
    libxml++ \
    mdbus2 \
    distro-feed-configs \
    mm-common \
    ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "ndctl", "", d)} \
    pim435 \
    proxy-libintl \
    safec \
    sdbus-c++-tools \
    sdbus-c++ \
    toybox \
    usleep \
    dbus-cxx \
"
RDEPENDS:packagegroup-meta-oe-core:append:libc-glibc = " ${@bb.utils.contains("DISTRO_FEATURES", "x11 opengl", "glfw", "", d)}"
RDEPENDS:packagegroup-meta-oe-core:remove:riscv64 = "safec"
RDEPENDS:packagegroup-meta-oe-core:remove:riscv32 = "safec"

RDEPENDS:packagegroup-meta-oe-crypto ="\
    botan \
    cryptsetup \
    fsverity-utils \
    libkcapi \
    libmcrypt \
    libsodium \
    pkcs11-helper \
"
RDEPENDS:packagegroup-meta-oe-crypto:remove:riscv32 = "botan"

RDEPENDS:packagegroup-meta-oe-dbs ="\
    influxdb \
    leveldb \
    libdbi \
    lmdb \
    mariadb \
    postgresql \
    psqlodbc \
    rocksdb \
    soci \
"
RDEPENDS:packagegroup-meta-oe-dbs:remove:libc-musl:powerpc = "rocksdb"

RDEPENDS:packagegroup-meta-oe-dbs-python2 ="\
    ${@bb.utils.contains("BBFILE_COLLECTIONS", "meta-python2", bb.utils.contains('I_SWEAR_TO_MIGRATE_TO_PYTHON3', 'yes', 'mysql-python', '', d), "", d)} \
"

RDEPENDS:packagegroup-meta-oe-devtools ="\
    abseil-cpp \
    apitrace \
    breakpad \
    android-tools-conf \
    android-tools \
    concurrencykit \
    cgdb \
    ctags \
    debootstrap \
    cjson \
    cloc \
    icon-slicer \
    cscope \
    dmalloc \
    ${@bb.utils.contains("PACKAGE_CLASSES", "package_rpm", "dnf-plugin-tui", "", d)} \
    doxygen \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "geany-plugins geany", "", d)} \
    jemalloc \
    lemon \
    flatbuffers \
    heaptrack \
    libparse-yapp-perl \
    libubox \
    ltrace \
    luajit \
    mcpp \
    memstat \
    giflib \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "glade", "", d)} \
    grpc \
    guider \
    php \
    iptraf-ng \
    jq \
    json-spirit \
    serialcheck \
    tclap \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "tk", "", d)} \
    uw-imap \
    jsoncpp \
    jsonrpc \
    yajl \
    yajl \
    kconfig-frontends \
    libgee \
    libsombok3 \
    lshw \
    luaposix \
    capnproto-compiler \
    mpich \
    msgpack-c \
    msgpack-cpp \
    mercurial \
    nodejs \
    openocd \
    pax-utils \
    ipc-run \
    libdbd-mysql-perl \
    libdbi-perl \
    libdev-checklib-perl \
    libio-pty-perl \
    libjson-perl \
    libperlio-gzip-perl \
    ply \
    protobuf-c \
    protobuf \
    pugixml \
    python3-distutils-extra \
    python3-pycups \
    rapidjson \
    squashfs-tools-ng \
    uftrace \
    valijson \
    libxerces-c \
    xerces-c-samples \
    xmlrpc-c \
    yasm \
    json-schema-validator \
    poke \
"
RDEPENDS:packagegroup-meta-oe-devtools:append:x86 = " cpuid msr-tools pahole pmtools"
RDEPENDS:packagegroup-meta-oe-devtools:append:x86-64 = " cpuid msr-tools pahole pcimem pmtools"
RDEPENDS:packagegroup-meta-oe-devtools:append:riscv64 = " pcimem"
RDEPENDS:packagegroup-meta-oe-devtools:append:arm = " pcimem"
RDEPENDS:packagegroup-meta-oe-devtools:append:aarch64 = " pahole pcimem"
RDEPENDS:packagegroup-meta-oe-devtools:append:libc-musl = " musl-nscd"

RDEPENDS:packagegroup-meta-oe-devtools:remove:arm = "concurrencykit"
RDEPENDS:packagegroup-meta-oe-devtools:remove:armv5 = "uftrace nodejs"
RDEPENDS:packagegroup-meta-oe-devtools:remove:mipsarch = "concurrencykit lshw ply uftrace"
RDEPENDS:packagegroup-meta-oe-devtools:remove:mips64 = "luajit nodejs"
RDEPENDS:packagegroup-meta-oe-devtools:remove:mips64el = "luajit nodejs"
RDEPENDS:packagegroup-meta-oe-devtools:remove:powerpc = "android-tools breakpad lshw luajit uftrace"
RDEPENDS:packagegroup-meta-oe-devtools:remove:powerpc64 = "android-tools breakpad lshw luajit ply uftrace"
RDEPENDS:packagegroup-meta-oe-devtools:remove:powerpc64le = "android-tools breakpad lshw luajit ply uftrace"
RDEPENDS:packagegroup-meta-oe-devtools:remove:riscv64 = "breakpad concurrencykit heaptrack lshw ltrace luajit nodejs ply uftrace"
RDEPENDS:packagegroup-meta-oe-devtools:remove:riscv32 = "breakpad concurrencykit heaptrack lshw ltrace luajit nodejs ply uftrace"
RDEPENDS:packagegroup-meta-oe-devtools:remove:libc-musl:riscv32 = "php"
RDEPENDS:packagegroup-meta-oe-devtools:remove:aarch64 = "concurrencykit"
RDEPENDS:packagegroup-meta-oe-devtools:remove:x86 = "ply"

RDEPENDS:packagegroup-meta-oe-extended ="\
    bitwise \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11 wayland opengl", "boinc-client", "", d)} \
    brotli \
    byacc \
    cmatrix \
    cmpi-bindings \
    collectd \
    ddrescue \
    dialog \
    duktape \
    enscript \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "gnuplot", "", d)} \
    dlt-daemon \
    docopt.cpp \
    iotop \
    dumb-init \
    konkretcmpi \
    figlet \
    libcec \
    libdivecomputer \
    fluentbit \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "libgxim", "", d)} \
    liblognorm \
    libmodbus \
    haveged \
    hexedit \
    hiredis \
    hplip \
    hwloc \
    libleak \
    libuio \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "libwmf", "", d)} \
    libyang \
    lprng \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "icewm", "", d)} \
    md5deep \
    indent \
    jansson \
    nana \
    nicstat \
    ${@bb.utils.contains("DISTRO_FEATURES", "pam", "openwsman", "", d)} \
    p7zip \
    isomd5sum \
    jpnevulator \
    ${@bb.utils.contains("DISTRO_FEATURES", "polkit", "polkit-group-rule-datetime polkit-group-rule-network polkit", "", d)} \
    rarpd \
    redis \
    libfastjson \
    librelp \
    sblim-cmpi-devel \
    sblim-sfc-common \
    ${@bb.utils.contains("DISTRO_FEATURES", "pam", "sblim-sfcb ", "", d)} \
    sblim-sfcc \
    libblockdev \
    sgpio \
    smartmontools \
    can-utils \
    canutils \
    libsocketcan \
    libconfig \
    linuxconsole \
    uml-utilities \
    libidn \
    libqb \
    wipe \
    libzip \
    zram \
    libplist \
    libusbmuxd \
    liblockfile \
    liblogging \
    libpwquality \
    ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "libreport", "", d)} \
    libserialport \
    libstatgrab \
    lockfile-progs \
    logwatch \
    mraa \
    ostree \
    ${@bb.utils.contains("DISTRO_FEATURES", "pam", "pam-plugin-ccreds pam-plugin-ldapdb pam-ssh-agent-auth", "", d)} \
    pegtl \
    libfile-fnmatch-perl \
    rrdtool \
    sanlock \
    scsirastools \
    sedutil \
    libsigrok \
    libsigrokdecode \
    s-nail \
    sigrok-cli \
    snappy \
    tipcutils \
    tiptop \
    tmate \
    tmux \
    triggerhappy \
    upm \
    vlock \
    volume-key \
    wxwidgets \
    zlog \
    zstd \
    zsync-curl \
    redis-plus-plus \
"
RDEPENDS:packagegroup-meta-oe-extended:append:libc-musl = " libexecinfo"
RDEPENDS:packagegroup-meta-oe-extended:append:x86-64 = " pmdk libx86-1"
RDEPENDS:packagegroup-meta-oe-extended:append:x86 = " libx86-1"

RDEPENDS:packagegroup-meta-oe-extended:remove:libc-musl = "sysdig"
RDEPENDS:packagegroup-meta-oe-extended:remove:mipsarch = "upm mraa minifi-cpp tiptop"
RDEPENDS:packagegroup-meta-oe-extended:remove:mips = "sysdig"
RDEPENDS:packagegroup-meta-oe-extended:remove:powerpc = "upm mraa minifi-cpp"
RDEPENDS:packagegroup-meta-oe-extended:remove:powerpc64 = "upm mraa minifi-cpp"
RDEPENDS:packagegroup-meta-oe-extended:remove:powerpc64le = "upm mraa sysdig"
RDEPENDS:packagegroup-meta-oe-extended:remove:riscv64 = "upm libleak mraa sysdig tiptop"
RDEPENDS:packagegroup-meta-oe-extended:remove:riscv32 = "upm libleak mraa sysdig tiptop"

RDEPENDS:packagegroup-meta-oe-extended-python2 ="\
    ${@bb.utils.contains("BBFILE_COLLECTIONS", "meta-python2", bb.utils.contains('I_SWEAR_TO_MIGRATE_TO_PYTHON3', 'yes', 'openlmi-tools', '', d), "", d)} \
"

RDEPENDS:packagegroup-meta-oe-gnome ="\
    atkmm \
    gcab \
    gnome-common \
    gmime \
    libjcat \
    gtk+ \
    gtkmm3 \
    gtkmm \
    ${@bb.utils.contains("DISTRO_FEATURES", "gobject-introspection-data", "libpeas", "", d)} \
    pyxdg \
    vte9 \
    gnome-theme-adwaita \
    libxmlb \
"

RDEPENDS:packagegroup-meta-oe-graphics ="\
    cairomm \
    directfb-examples \
    directfb \
    fbgrab \
    dietsplash \
    ${@bb.utils.contains("PACKAGE_CLASSES", "package_rpm", "dnfdragora", "", d)} \
    fontforge \
    fbida \
    feh \
    ${@bb.utils.contains("DISTRO_FEATURES", "opengl", "freeglut", "", d)} \
    ftgl \
    fvwm \
    gtkperf \
    gphoto2 \
    imlib2 \
    libgphoto2 \
    graphviz \
    gtkwave \
    jasper \
    libforms \
    lxdm \
    numlockx \
    nyancat \
    obconf \
    openbox \
    packagegroup-fonts-truetype \
    qrencode \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "st", "", d)} \
    leptonica \
    libvncserver \
    libmng \
    libsdl-gfx \
    libsdl-image \
    libsdl-mixer \
    libsdl-net \
    libsdl-ttf \
    libsdl2-image \
    libsdl2-mixer \
    libsdl2-net \
    ${@bb.utils.contains("DISTRO_FEATURES", "opengl", "libsdl2-ttf", "", d)} \
    libsdl \
    ${@bb.utils.contains("DISTRO_FEATURES", "wayland", "lv-drivers lvgl lv-lib-png", "", d)} \
    ttf-arphic-uming \
    ttf-droid-sans ttf-droid-sans-mono ttf-droid-sans-fallback ttf-droid-sans-japanese ttf-droid-serif \
    ttf-abyssinica \
    source-han-sans-cn-fonts \
    source-han-sans-jp-fonts \
    source-han-sans-kr-fonts \
    source-han-sans-tw-fonts \
    source-code-pro-fonts \
    ttf-dejavu-sans \
    ttf-dejavu-sans-condensed \
    ttf-dejavu-sans-mono \
    ttf-dejavu-serif \
    ttf-dejavu-serif-condensed \
    ttf-dejavu-mathtexgyre \
    ttf-dejavu-common \
    ttf-gentium \
    ttf-hunky-sans \
    ttf-hunky-serif \
    ttf-ipag ttf-ipagp ttf-ipamp ttf-ipam \
    ttf-lohit \
    ttf-inconsolata \
    ttf-liberation-sans-narrow \
    ttf-liberation-mono \
    ttf-liberation-sans \
    ttf-liberation-serif \
    ttf-lklug \
    ttf-noto-emoji-color \
    ttf-noto-emoji-regular \
    ttf-sazanami-gothic \
    ttf-sazanami-mincho \
    ttf-takao-pgothic ttf-takao-gothic ttf-takao-pmincho ttf-takao-mincho \
    ttf-tlwg \
    ttf-roboto \
    ttf-wqy-zenhei \
    ttf-pt-sans \
    ttf-vlgothic \
    ttf-ubuntu-mono \
    ttf-ubuntu-sans \
    libyui-ncurses \
    libyui \
    x11vnc \
    terminus-font-consolefonts \
    terminus-font-pcf \
    xdotool \
    xkbevd \
    bdftopcf \
    iceauth \
    sessreg \
    xgamma \
    setxkbmap \
    xkbutils \
    twm \
    xclock \
    xfontsel \
    xkbprint \
    xlsatoms \
    xlsclients \
    xlsfonts \
    xmag \
    xmessage \
    xrdb \
    xrefresh \
    xsetroot \
    xstdcmap \
    xterm \
    xwd \
    xwud \
    xorg-sgml-doctools \
    xf86-input-tslib \
    xf86-input-void \
    xf86-video-armsoc \
    xf86-video-ati \
    font-adobe-100dpi \
    font-adobe-utopia-100dpi \
    font-bh-100dpi \
    font-bh-lucidatypewriter-100dpi \
    font-bitstream-100dpi \
    font-cursor-misc \
    font-misc-misc \
    xorg-fonts-100dpi \
    libxaw6 \
    libxpresent \
    xcb-util-cursor \
    xserver-common \
    openjpeg \
    pangomm \
    spirv-shader-generator \
    spirv-tools \
    stalonetray \
    surf \
    tesseract-lang \
    tesseract \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11 pam", "tigervnc", "", d)} \
    tslib \
    unclutter-xfixes \
    libvdpau \
    xcursorgen \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11 pam", "xscreensaver", "", d)} \
    yad \
    parallel-deqp-runner \
    ${@bb.utils.contains("DISTRO_FEATURES", "opengl", "opengl-es-cts", "", d)} \
    ${@bb.utils.contains("DISTRO_FEATURES", "opengl vulkan", "vulkan-cts", "", d)} \
"
RDEPENDS:packagegroup-meta-oe-graphics:append:x86 = " renderdoc xf86-video-nouveau xf86-video-mga"
RDEPENDS:packagegroup-meta-oe-graphics:append:x86-64 = " renderdoc xf86-video-nouveau xf86-video-mga"
RDEPENDS:packagegroup-meta-oe-graphics:append:arm = " renderdoc"
RDEPENDS:packagegroup-meta-oe-graphics:append:aarch64 = " renderdoc"

RDEPENDS:packagegroup-meta-oe-graphics:remove:libc-musl = "renderdoc"

RDEPENDS:packagegroup-meta-oe-kernel ="\
    agent-proxy \
    crash \
    cpupower \
    ipmitool \
    broadcom-bt-firmware \
    kernel-selftest \
    minicoredumper \
    oprofile \
    spidev-test \
    trace-cmd \
    usbip-tools \
"
RDEPENDS:packagegroup-meta-oe-kernel:append:x86 = " intel-speed-select ipmiutil pm-graph turbostat"
RDEPENDS:packagegroup-meta-oe-kernel:append:x86-64 = " intel-speed-select ipmiutil pm-graph turbostat bpftool"
RDEPENDS:packagegroup-meta-oe-kernel:append:x86-64:libc-glibc = " kpatch"
RDEPENDS:packagegroup-meta-oe-kernel:append:powerpc64 = " libpfm4"

# Kernel-selftest does not build with 5.8 and its exluded from build too so until its fixed remove it
RDEPENDS:packagegroup-meta-oe-kernel:remove = "kernel-selftest"
RDEPENDS:packagegroup-meta-oe-kernel:remove:libc-musl = "bpftool crash intel-speed-select kernel-selftest minicoredumper turbostat"

RDEPENDS:packagegroup-meta-oe-kernel:remove:mipsarch = "makedumpfile"
RDEPENDS:packagegroup-meta-oe-kernel:remove:mips64 = "crash"
RDEPENDS:packagegroup-meta-oe-kernel:remove:mips64el = "crash"

RDEPENDS:packagegroup-meta-oe-kernel:remove:riscv64 = "crash makedumpfile oprofile"
RDEPENDS:packagegroup-meta-oe-kernel:remove:riscv32 = "crash makedumpfile oprofile"

RDEPENDS:packagegroup-meta-oe-multimedia ="\
    ${@bb.utils.contains("LICENSE_FLAGS_ACCEPTED", "commercial", "faad2", "", d)} \
    dirsplit \
    genisoimage \
    icedax \
    wodim \
    id3lib \
    audiofile \
    a2jmidid \
    jack-server \
    jack-utils \
    libass \
    libcdio-paranoia \
    libcdio \
    ${@bb.utils.contains("LICENSE_FLAGS_ACCEPTED", "commercial", "libmad", "", d)} \
    libmms \
    libdvdread \
    libopus \
    live555-examples \
    live555-mediaserver \
    libmikmod \
    libmodplug \
    sound-theme-freedesktop \
    yavta \
    v4l-utils \
    wavpack \
    libvpx \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "xsp", "", d)} \
    ${@bb.utils.contains("LICENSE_FLAGS_ACCEPTED", "commercial", "mpv", "", d)} \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "pavucontrol", "", d)} \
    libopusenc \
"

RDEPENDS:packagegroup-meta-oe-navigation ="\
    geos \
    ${@bb.utils.contains("DISTRO_FEATURES", "bluz4", "gpsd-machine-conf gpsd", "", d)} \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "orrery", "", d)} \
    geoclue \
    libspatialite \
    proj \
"

RDEPENDS:packagegroup-meta-oe-printing ="\
    cups-filters \
    gutenprint \
    qpdf \
"

RDEPENDS:packagegroup-meta-oe-security ="\
    keyutils \
    nmap \
    ${@bb.utils.contains("DISTRO_FEATURES", "pam", "passwdqc", "", d)} \
    softhsm \
    tomoyo-tools \
    auditd \
"

RDEPENDS:packagegroup-meta-oe-shells ="\
    dash \
    mksh \
    tcsh \
    zsh \
"

RDEPENDS:packagegroup-meta-oe-support ="\
    anthy \
    atop \
    ace-cloud-editor \
    ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "driverctl", "", d)} \
    frame \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "geis", "", d)} \
    grail \
    asio \
    augeas \
    avro-c \
    bdwgc \
    c-ares \
    cmark \
    ${@bb.utils.contains("DISTRO_FEATURES", "polkit gobject-introspection-data", "colord", "", d)} \
    consolation \
    cpprest \
    ctapi-common \
    dfu-util \
    dhex \
    digitemp \
    dool \
    espeak \
    evemu-tools \
    exiv2 \
    libnice \
    c-periphery \
    fmt \
    function2 \
    gd \
    gflags \
    glog \
    gperftools \
    gpm \
    gsoap \
    hdf5 \
    hstr \
    htop \
    hunspell-dictionaries \
    hunspell \
    hwdata \
    iksemel \
    gengetopt \
    googlebenchmark \
    imagemagick \
    iniparser \
    inotify-tools \
    joe \
    lcms \
    lcov \
    imapfilter \
    libbytesize \
    libcyusbserial \
    libestr \
    libfann \
    libftdi \
    libjs-jquery-globalize \
    libjs-jquery-cookie \
    ccid \
    zchunk \
    libgpiod \
    libmanette \
    ckermit \
    libcereal \
    daemontools \
    libiio \
    devmem2 \
    libgit2 \
    libharu \
    eject \
    enca \
    epeg \
    libmxml \
    fbset-modes \
    fbset \
    liboop \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "fltk", "", d)} \
    freerdp \
    libgusb \
    emacs \
    libp11 \
    libraw1394 \
    gradm \
    gsl \
    librsync \
    hddtemp \
    hidapi \
    libsoc \
    libmimetic \
    libinih \
    libtar \
    libteam \
    libusb-compat \
    libatasmart \
    libcanberra \
    libssh \
    libssh2 \
    libee \
    libusbgx-config \
    libusbgx \
    lockdev \
    logwarn \
    libjs-sizzle \
    liblinebreak \
    mailcap \
    liboauth \
    mg \
    monit \
    mscgen \
    libsmi \
    remmina \
    neon \
    nmon \
    libjs-jquery-icheck \
    libtinyxml \
    libusbg \
    libutempter \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "links-x11", "links", d)} \
    log4c \
    log4cpp \
    nspr \
    libdevmapper \
    lvm2 \
    nss \
    mbuffer \
    onig \
    mime-support \
    minini \
    multipath-tools \
    numactl \
    clinfo \
    opencv \
    opensc \
    openct \
    openldap \
    wbxml2 \
    p910nd \
    libtinyxml2 \
    picocom \
    funyahoo-plusplus \
    icyque \
    libotr \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "pidgin-otr", "", d)} \
    pidgin \
    purple-skypeweb \
    pidgin-sipe \
    pngcheck \
    poco \
    poppler-data \
    poppler \
    portaudio-v19 \
    procmail \
    pxaregs \
    pv \
    rsnapshot \
    pps-tools \
    raptor2 \
    rdfind \
    re2 \
    sdparm \
    serial-forward \
    read-edid \
    spitools \
    libsass \
    sassc \
    smarty \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "synergy", "", d)} \
    syslog-ng \
    system-config-keyboard \
    tbb \
    satyr \
    pcp \
    pcsc-lite \
    pcsc-tools \
    sharutils \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "toscoterm", "", d)} \
    sg3-utils \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "uim", "", d)} \
    uchardet \
    srecord \
    ssiapi \
    tree \
    utouch-evemu \
    utouch-frame \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "utouch-mtview", "", d)} \
    ${@bb.utils.contains("DISTRO_FEATURES", "polkit", "udisks2", "", d)} \
    stm32flash \
    tokyocabinet \
    xmlstarlet \
    thin-provisioning-tools \
    uhubctl \
    zile \
    unixodbc \
    daemonize \
    upower \
    unicode-ucd \
    xdelta3 \
    uriparser \
    nano \
    xdg-user-dirs \
    xmlsec1 \
    usb-modeswitch-data \
    usb-modeswitch \
    liburing \
    zbar \
    libmicrohttpd \
    yaml-cpp \
"
RDEPENDS:packagegroup-meta-oe-support:append:armv7a = " ne10"
RDEPENDS:packagegroup-meta-oe-support:append:armv7ve = " ne10"
RDEPENDS:packagegroup-meta-oe-support:append:aarch64 = " ne10"
RDEPENDS:packagegroup-meta-oe-support:append:x86 = " mcelog mce-inject mce-test vboxguestdrivers"
RDEPENDS:packagegroup-meta-oe-support:append:x86-64 = " mcelog mce-inject mce-test vboxguestdrivers"

RDEPENDS:packagegroup-meta-oe-support-python2 ="\
    ${@bb.utils.contains("BBFILE_COLLECTIONS", "meta-python2", bb.utils.contains('I_SWEAR_TO_MIGRATE_TO_PYTHON3', 'yes', 'lio-utils', '', d), "", d)} \
"

RDEPENDS:packagegroup-meta-oe-support:remove:arm ="numactl"
RDEPENDS:packagegroup-meta-oe-support:remove:mipsarch = "gperftools"
RDEPENDS:packagegroup-meta-oe-support:remove:riscv64 = "gperftools uim"
RDEPENDS:packagegroup-meta-oe-support:remove:riscv32 = "gperftools uim"
RDEPENDS:packagegroup-meta-oe-support:remove:powerpc = "libcereal ssiapi tbb"
RDEPENDS:packagegroup-meta-oe-support:remove:powerpc64le = "libcereal ssiapi"
RDEPENDS:packagegroup-meta-oe-support:remove:libc-musl = "pcp"
RDEPENDS:packagegroup-meta-oe-support:remove:libc-musl:powerpc = "gsl"

RDEPENDS:packagegroup-meta-oe-test ="\
    bats \
    cmocka \
    cppunit \
    cpputest \
    cukinia \
    cunit \
    cxxtest \
    evtest \
    fb-test \
    fwts \
    googletest \
    pm-qa \
    testfloat \
"
RDEPENDS:packagegroup-meta-oe-test:remove:libc-musl = "pm-qa"
RDEPENDS:packagegroup-meta-oe-test:remove:arm = "fwts"
RDEPENDS:packagegroup-meta-oe-test:remove:mipsarch = "fwts"
RDEPENDS:packagegroup-meta-oe-test:remove:powerpc = "fwts"
RDEPENDS:packagegroup-meta-oe-test:remove:riscv64 = "fwts"
RDEPENDS:packagegroup-meta-oe-test:remove:riscv32 = "fwts"

RDEPENDS:packagegroup-meta-oe-ptest-packages = "\
    zeromq-ptest \
    leveldb-ptest \
    psqlodbc-ptest \
    protobuf-ptest \
    rsyslog-ptest \
    oprofile-ptest \
    libteam-ptest \
    uthash-ptest \
    libee-ptest \
    poco-ptest \
    cmocka-ptest \
    minicoredumper-ptest \
    hiredis-ptest \
"
RDEPENDS:packagegroup-meta-oe-ptest-packages:append:x86 = " mcelog-ptest"
RDEPENDS:packagegroup-meta-oe-ptest-packages:append:x86-64 = " mcelog-ptest"

RDEPENDS:packagegroup-meta-oe-ptest-packages:remove:riscv64 = "oprofile-ptest"
RDEPENDS:packagegroup-meta-oe-ptest-packages:remove:riscv32 = "oprofile-ptest"
RDEPENDS:packagegroup-meta-oe-ptest-packages:remove:arm = "numactl-ptest"
RDEPENDS:packagegroup-meta-oe-ptest-packages:remove:libc-musl = "minicoredumper-ptest"

RDEPENDS:packagegroup-meta-oe-fortran-packages = "\
    lapack \
    octave \
    suitesparse \
"
# library-only or headers-only packages
# They wont be built as part of images but might be interesting to include
# with dev-pkgs images
#
# opencl-headers sdbus-c++-libsystemd nlohmann-fifo sqlite-orm
# nlohmann-json exprtk liblightmodbus p8platform gnome-doc-utils-stub
# glm ttf-mplus xbitmaps ceres-solver cli11 fftw gnulib libeigen ade
# spdlog span-lite uthash websocketpp catch2 properties-cpp cpp-netlib

# rsyslog conflicts with syslog-ng so its not included here

EXCLUDE_FROM_WORLD = "1"

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded


text:
/**
 * donnie4w@gmail.com  tim server
 */
package connect

import (
	"context"
	"errors"
	"fmt"
	"runtime/debug"
	"sync"
	"time"

	. "tim/FW"

	"github.com/apache/thrift/lib/go/thrift"
	"github.com/donnie4w/go-logger/logger"

	. "tim/common"
	. "tim/protocol"
	. "tim/utils"
)

type TimPool struct {
	// 注册了的连接器
	pool map[*TimUser]bool
	//	pool *HashTable
	// 在线用户  domain+name
	poolUser map[string]map[*TimUser]bool
	//	poolUser *HashTable
	// 从连接器中注册请求
	register chan *TimUser
	// 从连接器中注销请求
	unregister chan *TimUser
	// 锁
	rwLock *sync.RWMutex
}

func (this *TimPool) AddAuthUser(tu *TimUser) {
	defer func() {
		if err := recover(); err != nil {
			logger.Error("AddAuthUser,", err)
			logger.Error(string(debug.Stack()))
		}
	}()
	this.rwLock.Lock()
	defer this.rwLock.Unlock()
	if _, ok := this.pool[tu]; ok {
		loginname, _ := GetLoginName(tu.UserTid)
		if len(this.poolUser[loginname]) == 0 {
			this.poolUser[loginname] = make(map[*TimUser]bool)
		}
		this.poolUser[loginname][tu] = true
	}
}

func (this *TimPool) AddSingleAuthUser(tu *TimUser) {
	defer func() {
		if err := recover(); err != nil {
			logger.Error("AddSingleAuthUser,", err)
			logger.Error(string(debug.Stack()))
		}
	}()
	this.rwLock.Lock()
	defer this.rwLock.Unlock()
	loginname, _ := GetLoginName(tu.UserTid)
	if pu, ok := this.poolUser[loginname]; ok {
		if pu != nil && len(pu) > 0 {
			for k, _ := range pu {
				k.Close()
				delete(pu, k)
				delete(this.pool, k)
			}
		}
	}
	if _, ok := this.pool[tu]; ok {
		if this.poolUser[loginname] == nil {
			this.poolUser[loginname] = make(map[*TimUser]bool)
		}
		this.poolUser[loginname][tu] = true
	}
}

func (this *TimPool) GetAllLoginName() (ss []string) {
	defer func() {
		if err := recover(); err != nil {
			logger.Error("GetAllLoginName,", err)
			logger.Error(string(debug.Stack()))
		}
	}()
	//	this.rwLock.RLock()
	//	defer this.rwLock.RUnlock()
	ss = make([]string, 0)
	for k, _ := range this.poolUser {
		ss = append(ss, k)
	}
	return
}

func (this *TimPool) DeleteTimUser(tu *TimUser) {
	defer func() {
		if err := recover(); err != nil {
			logger.Error("DeleteTimUser,", err)
			logger.Error(string(debug.Stack()))
		}
	}()
	this.rwLock.Lock()
	defer this.rwLock.Unlock()
	tu.Close()
	if tu.UserTid != nil {
		loginname, _ := GetLoginName(tu.UserTid)
		if tumap, ok := this.poolUser[loginname]; ok {
			if _, ok := tumap[tu]; ok {
				delete(tumap, tu)
				if len(tumap) == 0 {
					delete(this.poolUser, loginname)
				}
			}
		}
	}
	if _, ok := this.pool[tu]; ok {
		delete(this.pool, tu)
	}
}

func (t *TimPool) Len4PU() int {
	t.rwLock.RLock()
	defer t.rwLock.RUnlock()
	return len(t.poolUser)
}

func (t *TimPool) Len4P() int {
	t.rwLock.RLock()
	defer t.rwLock.RUnlock()
	return len(t.pool)
}

func (t *TimPool) PrintUsersInfo() string {
	t.rwLock.RLock()
	defer t.rwLock.RUnlock()
	str := fmt.Sprintln(len(t.pool), "======>", len(t.poolUser))
	for _, vmap := range t.poolUser {
		for tu, _ := range vmap {
			str = fmt.Sprintln(str, tu.UserTid.GetName(), " # ", TimeMills2TimeFormat(tu.IdCardNo), " # ", tu.UserTid.GetResource())
		}
	}
	return str
}

func (t *TimPool) GetLoginUser(loginname string) (tus []*TimUser) {
	t.rwLock.RLock()
	defer t.rwLock.RUnlock()
	if tumap, ok := t.poolUser[loginname]; ok {
		tus = make([]*TimUser, 0)
		for tu, _ := range tumap {
			tus = append(tus, tu)
		}
	}
	return
}

func (t *TimPool) AddConnect(c *TimUser) {
	t.rwLock.Lock()
	defer t.rwLock.Unlock()
	t.pool[c] = true
}

type TimUser struct {
	Ts               thrift.TTransport
	UserTid          *Tid
	Client           *ITimClient
	Fw               FLOW
	OverLimit        int
	IdCardNo         string
	IsClose          bool
	Sendflag         chan string
	Sync             *sync.Mutex
	LastSyncThreadId string
	UserType         int // 0 client  1 cluster client
	TLS              int //
	Interflow        int
	Version          int16
}

func (t *TimUser) Auth(tid *Tid) (er error) {
	defer func() {
		if err := recover(); err != nil {
			logger.Error("Auth,", err)
			logger.Error(string(debug.Stack()))
			er = errors.New("Auth err")
		}
	}()
	t.Sync.Lock()
	defer t.Sync.Unlock()
	t.UserTid = tid
	if CF.SingleClient == 1 {
		TP.AddSingleAuthUser(t)
	} else {
		TP.AddAuthUser(t)
	}
	return
}

func (t *TimUser) SendMBean(mbean *TimMBean) (er error) {
	defer func() {
		if err := recover(); err != nil {
			logger.Error("sendMBean error:", err)
			logger.Error(string(debug.Stack()))
			er = errors.New("sendMBean err")
		}
	}()
	t.Sync.Lock()
	defer t.Sync.Unlock()
	if t.IsClose {
		er = errors.New("timuser is close")
		return
	}
	if CF.ConfirmAck == 1 {
		timer := time.NewTicker(3 * time.Second)
		t.LastSyncThreadId = mbean.GetThreadId()
		er = t.Client.TimMessage(context.Background(), mbean)
		if er == nil {
			select {
			case <-timer.C:
				er = errors.New(fmt.Sprint(t.UserTid.GetName(), ", send ack overtime:", mbean.GetThreadId(), "  ", t))
				logger.Error("send ack overtime:", mbean.GetThreadId())
			case threadId := <-t.Sendflag:
				if t.LastSyncThreadId != threadId {
					er = errors.New(fmt.Sprint("error msg ack threadid:", t.LastSyncThreadId, "!=", threadId))
					logger.Error("error msg ack threadid:", t.LastSyncThreadId, "!=", threadId)
				}
			}
		} else {
			logger.Error("sendMBean:", er.Error())
		}
	} else {
		er = t.Client.TimMessage(context.Background(), mbean)
	}
	if er != nil {
		t.IsClose = true
		t.Fw = CLOSE
	}
	return
}

func (t *TimUser) SendMBeanList(mbeans []*TimMBean) (er error) {
	defer func() {
		if err := recover(); err != nil {
			logger.Error("SendMBeanList error:", err)
			logger.Error(string(debug.Stack()))
			er = errors.New("SendMBeanList err")
		}
	}()
	t.Sync.Lock()
	defer t.Sync.Unlock()
	if t.IsClose {
		er = errors.New("timuser is close")
		return
	}
	mbeanList := NewTimMBeanList()
	mbeanList.TimMBeanList = mbeans
	mbeanList.ThreadId = TimeMills()
	if CF.ConfirmAck == 1 {
		timer := time.NewTicker(5 * time.Second)
		t.LastSyncThreadId = mbeanList.GetThreadId()
		er = t.Client.TimMessageList(context.Background(), mbeanList)
		select {
		case <-timer.C:
			er = errors.New(fmt.Sprint("send ack overtime:", mbeanList.GetThreadId()))
			logger.Error("send ack overtime:", mbeanList.GetThreadId())
		case threadId := <-t.Sendflag:
			if mbeanList.GetThreadId() != threadId {
				er = errors.New(fmt.Sprint("error msg ack threadid:", mbeanList.GetThreadId(), "!=", threadId))
				logger.Error("error msg ack threadid:", mbeanList.GetThreadId(), "!=", threadId)
			}
		}
	} else {
		er = t.Client.TimMessageList(context.Background(), mbeanList)
	}
	if er != nil {
		t.IsClose = true
		t.Fw = CLOSE
	}
	return
}

func (t *TimUser) Ping() (er error) {
	defer func() {
		if err := recover(); err != nil {
			logger.Error("Ping,", err)
			logger.Error(string(debug.Stack()))
			er = errors.New("Ping err")
		}
	}()
	t.Sync.Lock()
	defer t.Sync.Unlock()
	er = t.Client.TimPing(context.Background(), TimeMills())
	return
}

func (t *TimUser) SendPBean(pbean *TimPBean) (er error) {
	defer func() {
		if err := recover(); err != nil {
			logger.Error("sendPBean,", err)
			logger.Error(string(debug.Stack()))
			er = errors.New("sendPBean err")
		}
	}()
	if CF.Presence != 1 {
		return
	}
	t.Sync.Lock()
	defer t.Sync.Unlock()
	er = t.Client.TimPresence(context.Background(), pbean)
	return
}

func (t *TimUser) SendPBeanList(pbean []*TimPBean) (er error) {
	defer func() {
		if err := recover(); err != nil {
			logger.Error("SendPBeanList,", err)
			logger.Error(string(debug.Stack()))
			er = errors.New("SendPBeanList err")
		}
	}()
	if CF.Presence != 1 {
		return
	}
	t.Sync.Lock()
	defer t.Sync.Unlock()
	pbeanList := NewTimPBeanList()
	pbeanList.ThreadId = TimeMills()
	pbeanList.TimPBeanList = pbean
	er = t.Client.TimPresenceList(context.Background(), pbeanList)
	return
}

func (t *TimUser) SendAckBean(ackBean *TimAckBean) (er error) {
	defer func() {
		if err := recover(); err != nil {
			logger.Error("sendAckBean,", err)
			logger.Error(string(debug.Stack()))
			er = errors.New("sendAckBean err")
		}
	}()
	t.Sync.Lock()
	defer t.Sync.Unlock()
	er = t.Client.TimAck(context.Background(), ackBean)
	return
}

func (t *TimUser) Close() (er error) {
	defer func() {
		if err := recover(); err != nil {
			logger.Error("Close,", err)
			logger.Error(string(debug.Stack()))
			er = errors.New("Close err")
		}
	}()
	t.Sync.Lock()
	defer t.Sync.Unlock()
	er = t.Ts.Close()
	return
}

func GetLoginName(tid *Tid) (loginname string, er error) {
	defer func() {
		if err := recover(); err != nil {
			logger.Error("GetLoginName,", err)
			logger.Error(string(debug.Stack()))
			er = errors.New("GetLoginName err")
		}
	}()
	if tid == nil || tid.GetDomain() == "" || tid.GetName() == "" {
		return "", errors.New("tid error")
	}
	domain := tid.GetDomain()
	name := tid.GetName()
	loginname = MD5(fmt.Sprint(domain, "tim", name))
	return
}

var TP = TimPool{
	register:   make(chan *TimUser),
	unregister: make(chan *TimUser),
	pool:       make(map[*TimUser]bool),
	poolUser:   make(map[string]map[*TimUser]bool),
	rwLock:     new(sync.RWMutex),
}


text:
package go_thunder

import (
	"bytes"
	"encoding/json"
	"io/ioutil"
	"util"
)

type WebCategoryCategoryList struct {
	Name WebCategoryCategoryListInstance `json:"category-list,omitempty"`
}

type WebCategoryCategoryListInstance struct {
	Abortion                    int                         `json:"abortion,omitempty"`
	AdultAndPornography         int                         `json:"adult-and-pornography,omitempty"`
	AlcoholAndTobacco           int                         `json:"alcohol-and-tobacco,omitempty"`
	Auctions                    int                         `json:"auctions,omitempty"`
	BotNets                     int                         `json:"bot-nets,omitempty"`
	BusinessAndEconomy          int                         `json:"business-and-economy,omitempty"`
	Cdns                        int                         `json:"cdns,omitempty"`
	Cheating                    int                         `json:"cheating,omitempty"`
	ComputerAndInternetInfo     int                         `json:"computer-and-internet-info,omitempty"`
	ComputerAndInternetSecurity int                         `json:"computer-and-internet-security,omitempty"`
	ConfirmedSpamSources        int                         `json:"confirmed-spam-sources,omitempty"`
	CultAndOccult               int                         `json:"cult-and-occult,omitempty"`
	Dating                      int                         `json:"dating,omitempty"`
	DeadSites                   int                         `json:"dead-sites,omitempty"`
	Drugs                       int                         `json:"drugs,omitempty"`
	DynamicComment              int                         `json:"dynamic-comment,omitempty"`
	EducationalInstitutions     int                         `json:"educational-institutions,omitempty"`
	EntertainmentAndArts        int                         `json:"entertainment-and-arts,omitempty"`
	FashionAndBeauty            int                         `json:"fashion-and-beauty,omitempty"`
	FinancialServices           int                         `json:"financial-services,omitempty"`
	FoodAndDining               int                         `json:"food-and-dining,omitempty"`
	Gambling                    int                         `json:"gambling,omitempty"`
	Games                       int                         `json:"games,omitempty"`
	Government                  int                         `json:"government,omitempty"`
	Gross                       int                         `json:"gross,omitempty"`
	Hacking                     int                         `json:"hacking,omitempty"`
	HateAndRacism               int                         `json:"hate-and-racism,omitempty"`
	HealthAndMedicine           int                         `json:"health-and-medicine,omitempty"`
	HomeAndGarden               int                         `json:"home-and-garden,omitempty"`
	HuntingAndFishing           int                         `json:"hunting-and-fishing,omitempty"`
	Illegal                     int                         `json:"illegal,omitempty"`
	ImageAndVideoSearch         int                         `json:"image-and-video-search,omitempty"`
	InternetCommunications      int                         `json:"internet-communications,omitempty"`
	InternetPortals             int                         `json:"internet-portals,omitempty"`
	JobSearch                   int                         `json:"job-search,omitempty"`
	KeyloggersAndMonitoring     int                         `json:"keyloggers-and-monitoring,omitempty"`
	Kids                        int                         `json:"kids,omitempty"`
	Legal                       int                         `json:"legal,omitempty"`
	LocalInformation            int                         `json:"local-information,omitempty"`
	MalwareSites                int                         `json:"malware-sites,omitempty"`
	Marijuana                   int                         `json:"marijuana,omitempty"`
	Military                    int                         `json:"military,omitempty"`
	MotorVehicles               int                         `json:"motor-vehicles,omitempty"`
	Music                       int                         `json:"music,omitempty"`
	Name                        string                      `json:"name,omitempty"`
	NewsAndMedia                int                         `json:"news-and-media,omitempty"`
	Nudity                      int                         `json:"nudity,omitempty"`
	OnlineGreetingCards         int                         `json:"online-greeting-cards,omitempty"`
	OpenHTTPProxies             int                         `json:"open-http-proxies,omitempty"`
	ParkedDomains               int                         `json:"parked-domains,omitempty"`
	PayToSurf                   int                         `json:"pay-to-surf,omitempty"`
	PeerToPeer                  int                         `json:"peer-to-peer,omitempty"`
	PersonalSitesAndBlogs       int                         `json:"personal-sites-and-blogs,omitempty"`
	PersonalStorage             int                         `json:"personal-storage,omitempty"`
	PhilosophyAndPolitics       int                         `json:"philosophy-and-politics,omitempty"`
	PhishingAndOtherFraud       int                         `json:"phishing-and-other-fraud,omitempty"`
	PrivateIPAddresses          int                         `json:"private-ip-addresses,omitempty"`
	ProxyAvoidAndAnonymizers    int                         `json:"proxy-avoid-and-anonymizers,omitempty"`
	Questionable                int                         `json:"questionable,omitempty"`
	RealEstate                  int                         `json:"real-estate,omitempty"`
	RecreationAndHobbies        int                         `json:"recreation-and-hobbies,omitempty"`
	ReferenceAndResearch        int                         `json:"reference-and-research,omitempty"`
	Religion                    int                         `json:"religion,omitempty"`
	Counters1                   []WebCategorySamplingEnable `json:"sampling-enable,omitempty"`
	SearchEngines               int                         `json:"search-engines,omitempty"`
	SexEducation                int                         `json:"sex-education,omitempty"`
	SharewareAndFreeware        int                         `json:"shareware-and-freeware,omitempty"`
	Shopping                    int                         `json:"shopping,omitempty"`
	SocialNetwork               int                         `json:"social-network,omitempty"`
	Society                     int                         `json:"society,omitempty"`
	SpamUrls                    int                         `json:"spam-urls,omitempty"`
	Sports                      int                         `json:"sports,omitempty"`
	SpywareAndAdware            int                         `json:"spyware-and-adware,omitempty"`
	StockAdviceAndTools         int                         `json:"stock-advice-and-tools,omitempty"`
	StreamingMedia              int                         `json:"streaming-media,omitempty"`
	SwimsuitsAndIntimateApparel int                         `json:"swimsuits-and-intimate-apparel,omitempty"`
	TrainingAndTools            int                         `json:"training-and-tools,omitempty"`
	Translation                 int                         `json:"translation,omitempty"`
	Travel                      int                         `json:"travel,omitempty"`
	UUID                        string                      `json:"uuid,omitempty"`
	Uncategorized               int                         `json:"uncategorized,omitempty"`
	UnconfirmedSpamSources      int                         `json:"unconfirmed-spam-sources,omitempty"`
	UserTag                     string                      `json:"user-tag,omitempty"`
	Violence                    int                         `json:"violence,omitempty"`
	Weapons                     int                         `json:"weapons,omitempty"`
	WebAdvertisements           int                         `json:"web-advertisements,omitempty"`
	WebBasedEmail               int                         `json:"web-based-email,omitempty"`
	WebHostingSites             int                         `json:"web-hosting-sites,omitempty"`
}

type WebCategorySamplingEnable struct {
	Counters1 string `json:"counters1,omitempty"`
}

func PostWebCategoryCategoryList(id string, inst WebCategoryCategoryList, host string) error {

	logger := util.GetLoggerInstance()

	var headers = make(map[string]string)
	headers["Accept"] = "application/json"
	headers["Content-Type"] = "application/json"
	headers["Authorization"] = id
	logger.Println("[INFO] Inside PostWebCategoryCategoryList")
	payloadBytes, err := json.Marshal(inst)
	logger.Println("[INFO] input payload bytes - " + string((payloadBytes)))
	if err != nil {
		logger.Println("[INFO] Marshalling failed with error ", err)
	}

	resp, err := DoHttp("POST", "https://"+host+"/axapi/v3/web-category/category-list", bytes.NewReader(payloadBytes), headers)

	if err != nil {
		logger.Println("The HTTP request failed with error ", err)
		return err

	} else {
		data, _ := ioutil.ReadAll(resp.Body)
		var m WebCategoryCategoryList
		erro := json.Unmarshal(data, &m)
		if erro != nil {
			logger.Println("Unmarshal error ", err)

		} else {
			logger.Println("[INFO] Post REQ RES..........................", m)
			err := check_api_status("PostWebCategoryCategoryList", data)
			if err != nil {
				return err
			}

		}
	}
	return err
}

func GetWebCategoryCategoryList(id string, name1 string, host string) (*WebCategoryCategoryList, error) {

	logger := util.GetLoggerInstance()

	var headers = make(map[string]string)
	headers["Accept"] = "application/json"
	headers["Content-Type"] = "application/json"
	headers["Authorization"] = id
	logger.Println("[INFO] Inside GetWebCategoryCategoryList")

	resp, err := DoHttp("GET", "https://"+host+"/axapi/v3/web-category/category-list/"+name1, nil, headers)

	if err != nil {
		logger.Println("The HTTP request failed with error ", err)
		return nil, err

	} else {
		data, _ := ioutil.ReadAll(resp.Body)
		var m WebCategoryCategoryList
		erro := json.Unmarshal(data, &m)
		if erro != nil {
			logger.Println("Unmarshal error ", err)
			return nil, err
		} else {
			logger.Println("[INFO] Get REQ RES..........................", m)
			err := check_api_status("GetWebCategoryCategoryList", data)
			if err != nil {
				return nil, err
			}
			return &m, nil
		}
	}

}

func PutWebCategoryCategoryList(id string, name1 string, inst WebCategoryCategoryList, host string) error {

	logger := util.GetLoggerInstance()

	var headers = make(map[string]string)
	headers["Accept"] = "application/json"
	headers["Content-Type"] = "application/json"
	headers["Authorization"] = id
	logger.Println("[INFO] Inside PutWebCategoryCategoryList")
	payloadBytes, err := json.Marshal(inst)
	logger.Println("[INFO] input payload bytes - " + string((payloadBytes)))
	if err != nil {
		logger.Println("[INFO] Marshalling failed with error ", err)
	}

	resp, err := DoHttp("PUT", "https://"+host+"/axapi/v3/web-category/category-list/"+name1, bytes.NewReader(payloadBytes), headers)

	if err != nil {
		logger.Println("The HTTP request failed with error ", err)
		return err

	} else {
		data, _ := ioutil.ReadAll(resp.Body)
		var m WebCategoryCategoryList
		erro := json.Unmarshal(data, &m)
		if erro != nil {
			logger.Println("Unmarshal error ", err)

		} else {
			logger.Println("[INFO] Put REQ RES..........................", m)
			err := check_api_status("PutWebCategoryCategoryList", data)
			if err != nil {
				return err
			}

		}
	}
	return err
}

func DeleteWebCategoryCategoryList(id string, name1 string, host string) error {

	logger := util.GetLoggerInstance()

	var headers = make(map[string]string)
	headers["Accept"] = "application/json"
	headers["Content-Type"] = "application/json"
	headers["Authorization"] = id
	logger.Println("[INFO] Inside DeleteWebCategoryCategoryList")

	resp, err := DoHttp("DELETE", "https://"+host+"/axapi/v3/web-category/category-list/"+name1, nil, headers)

	if err != nil {
		logger.Println("The HTTP request failed with error ", err)
		return err
		return err
	} else {
		data, _ := ioutil.ReadAll(resp.Body)
		var m WebCategoryCategoryList
		erro := json.Unmarshal(data, &m)
		if erro != nil {
			logger.Println("Unmarshal error ", err)
			return err
		} else {
			logger.Println("[INFO] Delete REQ RES..........................", m)
			err := check_api_status("DeleteWebCategoryCategoryList", data)
			if err != nil {
				return err
			}

		}
	}
	return nil
}

repository: DanielAtella/terraform-provider-thunder

repo_name: DanielAtella/terraform-provider-thunder