You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2022/05/23 12:26:15 UTC
[plc4x] branch develop updated: feat(plc4go): expose selected set of utils for public usage
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/develop by this push:
new 7e0ccdb657 feat(plc4go): expose selected set of utils for public usage
7e0ccdb657 is described below
commit 7e0ccdb65726d53b341ee8680c03152556d64f5d
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Mon May 23 14:26:07 2022 +0200
feat(plc4go): expose selected set of utils for public usage
---
plc4go/utils/exposedUtils.go | 44 ++++++++++++++++++++++++++++++++++++++++++++
plc4go/utils/init.go | 21 +++++++++++++++++++++
2 files changed, 65 insertions(+)
diff --git a/plc4go/utils/exposedUtils.go b/plc4go/utils/exposedUtils.go
new file mode 100644
index 0000000000..01b8582fc4
--- /dev/null
+++ b/plc4go/utils/exposedUtils.go
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package utils
+
+import (
+ "github.com/apache/plc4x/plc4go/internal/spi/utils"
+)
+
+// NewReadBufferByteBased creates a byte based read buffer
+func NewReadBufferByteBased(data []byte) utils.ReadBufferByteBased {
+ return utils.NewReadBufferByteBased(data)
+}
+
+// NewLittleEndianReadBufferByteBased creates a little endian byte based read buffer
+func NewLittleEndianReadBufferByteBased(data []byte) utils.ReadBufferByteBased {
+ return utils.NewLittleEndianReadBufferByteBased(data)
+}
+
+// NewWriteBufferByteBased creates a byte based write buffer
+func NewWriteBufferByteBased() utils.WriteBufferByteBased {
+ return utils.NewWriteBufferByteBased()
+}
+
+// NewLittleEndianWriteBufferByteBased creates a little endian byte write read buffer
+func NewLittleEndianWriteBufferByteBased() utils.WriteBufferByteBased {
+ return utils.NewLittleEndianWriteBufferByteBased()
+}
diff --git a/plc4go/utils/init.go b/plc4go/utils/init.go
new file mode 100644
index 0000000000..7d220439fd
--- /dev/null
+++ b/plc4go/utils/init.go
@@ -0,0 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Package utils contains utils exposed from the internal spi
+package utils