mirror of
https://github.com/safing/portbase
synced 2025-04-21 01:49:07 +00:00
Update import paths
This commit is contained in:
parent
9cd2894afc
commit
8f3082f96f
78 changed files with 153 additions and 154 deletions
README.md
api
apitest.gobuildconfig
container
crypto
database
accessor
boilerplate_test.gocontroller.gocontrollers.godatabase_test.godbmodule
hook.gohookbase.gointerface.goiterator
maintenance.goquery
condition-and.gocondition-bool.gocondition-error.gocondition-exists.gocondition-float.gocondition-int.gocondition-not.gocondition-or.gocondition-regex.gocondition-string.gocondition-stringslice.gocondition.goquery.goquery_test.go
record
storage
subscription.goformats/dsd
info
log
modules
notifications
portbase.goutils/osdetail/test
|
@ -118,9 +118,9 @@ If you build everything with modules, your main program should be similar to thi
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/Safing/portbase/info"
|
"github.com/safing/portbase/info"
|
||||||
"github.com/Safing/portbase/log"
|
"github.com/safing/portbase/log"
|
||||||
"github.com/Safing/portbase/modules"
|
"github.com/safing/portbase/modules"
|
||||||
|
|
||||||
// include packages here
|
// include packages here
|
||||||
_ "path/to/my/custom/module"
|
_ "path/to/my/custom/module"
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Safing/portbase/log"
|
"github.com/safing/portbase/log"
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
"github.com/tevino/abool"
|
"github.com/tevino/abool"
|
||||||
)
|
)
|
||||||
|
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/Safing/portbase/container"
|
"github.com/safing/portbase/container"
|
||||||
"github.com/Safing/portbase/formats/dsd"
|
"github.com/safing/portbase/formats/dsd"
|
||||||
"github.com/tevino/abool"
|
"github.com/tevino/abool"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/Safing/portbase/log"
|
"github.com/safing/portbase/log"
|
||||||
"github.com/tevino/abool"
|
"github.com/tevino/abool"
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
|
|
|
@ -3,8 +3,8 @@ package api
|
||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
|
|
||||||
"github.com/Safing/portbase/config"
|
"github.com/safing/portbase/config"
|
||||||
"github.com/Safing/portbase/log"
|
"github.com/safing/portbase/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -10,11 +10,11 @@ import (
|
||||||
"github.com/tevino/abool"
|
"github.com/tevino/abool"
|
||||||
"github.com/tidwall/gjson"
|
"github.com/tidwall/gjson"
|
||||||
|
|
||||||
"github.com/Safing/portbase/container"
|
"github.com/safing/portbase/container"
|
||||||
"github.com/Safing/portbase/database"
|
"github.com/safing/portbase/database"
|
||||||
"github.com/Safing/portbase/database/query"
|
"github.com/safing/portbase/database/query"
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
"github.com/Safing/portbase/log"
|
"github.com/safing/portbase/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package api
|
package api
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Safing/portbase/modules"
|
"github.com/safing/portbase/modules"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
|
|
||||||
"github.com/Safing/portbase/log"
|
"github.com/safing/portbase/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -3,7 +3,7 @@ package testclient
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/Safing/portbase/api"
|
"github.com/safing/portbase/api"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
16
apitest.go
16
apitest.go
|
@ -7,16 +7,16 @@ import (
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Safing/portbase/info"
|
"github.com/safing/portbase/info"
|
||||||
"github.com/Safing/portbase/log"
|
"github.com/safing/portbase/log"
|
||||||
"github.com/Safing/portbase/modules"
|
"github.com/safing/portbase/modules"
|
||||||
// include packages here
|
// include packages here
|
||||||
|
|
||||||
_ "github.com/Safing/portbase/api"
|
_ "github.com/safing/portbase/api"
|
||||||
_ "github.com/Safing/portbase/api/testclient"
|
_ "github.com/safing/portbase/api/testclient"
|
||||||
"github.com/Safing/portbase/config"
|
"github.com/safing/portbase/config"
|
||||||
_ "github.com/Safing/portbase/crypto/random"
|
_ "github.com/safing/portbase/crypto/random"
|
||||||
_ "github.com/Safing/portbase/database/dbmodule"
|
_ "github.com/safing/portbase/database/dbmodule"
|
||||||
)
|
)
|
||||||
|
|
||||||
// var (
|
// var (
|
||||||
|
|
2
build
2
build
|
@ -48,5 +48,5 @@ echo "This information is useful for debugging and license compliance."
|
||||||
echo "Run the compiled binary with the -version flag to see the information included."
|
echo "Run the compiled binary with the -version flag to see the information included."
|
||||||
|
|
||||||
# build
|
# build
|
||||||
BUILD_PATH="github.com/Safing/portbase/info"
|
BUILD_PATH="github.com/safing/portbase/info"
|
||||||
go build -ldflags "-X ${BUILD_PATH}.commit=${BUILD_COMMIT} -X ${BUILD_PATH}.buildOptions=${BUILD_BUILDOPTIONS} -X ${BUILD_PATH}.buildUser=${BUILD_USER} -X ${BUILD_PATH}.buildHost=${BUILD_HOST} -X ${BUILD_PATH}.buildDate=${BUILD_DATE} -X ${BUILD_PATH}.buildSource=${BUILD_SOURCE}" $@
|
go build -ldflags "-X ${BUILD_PATH}.commit=${BUILD_COMMIT} -X ${BUILD_PATH}.buildOptions=${BUILD_BUILDOPTIONS} -X ${BUILD_PATH}.buildUser=${BUILD_USER} -X ${BUILD_PATH}.buildHost=${BUILD_HOST} -X ${BUILD_PATH}.buildDate=${BUILD_DATE} -X ${BUILD_PATH}.buildSource=${BUILD_SOURCE}" $@
|
||||||
|
|
|
@ -5,12 +5,12 @@ import (
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/Safing/portbase/log"
|
"github.com/safing/portbase/log"
|
||||||
"github.com/Safing/portbase/database"
|
"github.com/safing/portbase/database"
|
||||||
"github.com/Safing/portbase/database/storage"
|
"github.com/safing/portbase/database/storage"
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
"github.com/Safing/portbase/database/query"
|
"github.com/safing/portbase/database/query"
|
||||||
"github.com/Safing/portbase/database/iterator"
|
"github.com/safing/portbase/database/iterator"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -3,7 +3,7 @@ package config
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/Safing/portbase/log"
|
"github.com/safing/portbase/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func parseAndSetConfig(jsonData string) error {
|
func parseAndSetConfig(jsonData string) error {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/Safing/portbase/log"
|
"github.com/safing/portbase/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database"
|
"github.com/safing/portbase/database"
|
||||||
"github.com/Safing/portbase/modules"
|
"github.com/safing/portbase/modules"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
|
|
||||||
"github.com/tidwall/sjson"
|
"github.com/tidwall/sjson"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Variable Type IDs for frontend Identification. Use ExternalOptType for extended types in the frontend.
|
// Variable Type IDs for frontend Identification. Use ExternalOptType for extended types in the frontend.
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/Safing/portbase/log"
|
"github.com/safing/portbase/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
// Package container gives you a []byte slice on steroids, allowing for quick data appending, prepending and fetching as well as transparent error transportation.
|
|
||||||
package container
|
package container
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/Safing/portbase/formats/varint"
|
"github.com/safing/portbase/formats/varint"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Container is []byte sclie on steroids, allowing for quick data appending, prepending and fetching as well as transparent error transportation. (Error transportation requires use of varints for data)
|
// Container is []byte sclie on steroids, allowing for quick data appending, prepending and fetching as well as transparent error transportation. (Error transportation requires use of varints for data)
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/Safing/portbase/utils"
|
"github.com/safing/portbase/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/Safing/portbase/formats/varint"
|
"github.com/safing/portbase/formats/varint"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Hash struct {
|
type Hash struct {
|
||||||
|
|
|
@ -5,8 +5,8 @@ import (
|
||||||
|
|
||||||
"github.com/tevino/abool"
|
"github.com/tevino/abool"
|
||||||
|
|
||||||
"github.com/Safing/portbase/config"
|
"github.com/safing/portbase/config"
|
||||||
"github.com/Safing/portbase/container"
|
"github.com/safing/portbase/container"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"math"
|
"math"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Safing/portbase/config"
|
"github.com/safing/portbase/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Safing/portbase/log"
|
"github.com/safing/portbase/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func osFeeder() {
|
func osFeeder() {
|
||||||
|
|
|
@ -9,8 +9,8 @@ import (
|
||||||
"github.com/aead/serpent"
|
"github.com/aead/serpent"
|
||||||
"github.com/seehuhn/fortuna"
|
"github.com/seehuhn/fortuna"
|
||||||
|
|
||||||
"github.com/Safing/portbase/config"
|
"github.com/safing/portbase/config"
|
||||||
"github.com/Safing/portbase/modules"
|
"github.com/safing/portbase/modules"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -3,7 +3,7 @@ package random
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/Safing/portbase/config"
|
"github.com/safing/portbase/config"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Safing/portbase/crypto/random"
|
"github.com/safing/portbase/crypto/random"
|
||||||
)
|
)
|
||||||
|
|
||||||
func noise() {
|
func noise() {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/Safing/portbase/utils"
|
"github.com/safing/portbase/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TestStruct struct {
|
type TestStruct struct {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Example struct {
|
type Example struct {
|
||||||
|
|
|
@ -5,10 +5,10 @@ import (
|
||||||
|
|
||||||
"github.com/tevino/abool"
|
"github.com/tevino/abool"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/iterator"
|
"github.com/safing/portbase/database/iterator"
|
||||||
"github.com/Safing/portbase/database/query"
|
"github.com/safing/portbase/database/query"
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
"github.com/Safing/portbase/database/storage"
|
"github.com/safing/portbase/database/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
// A Controller takes care of all the extra database logic.
|
// A Controller takes care of all the extra database logic.
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/storage"
|
"github.com/safing/portbase/database/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -10,10 +10,10 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
q "github.com/Safing/portbase/database/query"
|
q "github.com/safing/portbase/database/query"
|
||||||
_ "github.com/Safing/portbase/database/storage/badger"
|
_ "github.com/safing/portbase/database/storage/badger"
|
||||||
_ "github.com/Safing/portbase/database/storage/bbolt"
|
_ "github.com/safing/portbase/database/storage/bbolt"
|
||||||
_ "github.com/Safing/portbase/database/storage/fstree"
|
_ "github.com/safing/portbase/database/storage/fstree"
|
||||||
)
|
)
|
||||||
|
|
||||||
func makeKey(dbName, key string) string {
|
func makeKey(dbName, key string) string {
|
||||||
|
|
|
@ -5,8 +5,8 @@ import (
|
||||||
"flag"
|
"flag"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database"
|
"github.com/safing/portbase/database"
|
||||||
"github.com/Safing/portbase/modules"
|
"github.com/safing/portbase/modules"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -3,8 +3,8 @@ package dbmodule
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database"
|
"github.com/safing/portbase/database"
|
||||||
"github.com/Safing/portbase/log"
|
"github.com/safing/portbase/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package database
|
package database
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Safing/portbase/database/query"
|
"github.com/safing/portbase/database/query"
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Hook describes a hook
|
// Hook describes a hook
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package database
|
package database
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
)
|
)
|
||||||
|
|
||||||
// HookBase implements the Hook interface and provides dummy functions to reduce boilerplate.
|
// HookBase implements the Hook interface and provides dummy functions to reduce boilerplate.
|
||||||
|
|
|
@ -7,10 +7,10 @@ import (
|
||||||
|
|
||||||
"github.com/bluele/gcache"
|
"github.com/bluele/gcache"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/accessor"
|
"github.com/safing/portbase/database/accessor"
|
||||||
"github.com/Safing/portbase/database/iterator"
|
"github.com/safing/portbase/database/iterator"
|
||||||
"github.com/Safing/portbase/database/query"
|
"github.com/safing/portbase/database/query"
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
|
|
||||||
"github.com/tevino/abool"
|
"github.com/tevino/abool"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Iterator defines the iterator structure.
|
// Iterator defines the iterator structure.
|
||||||
|
|
|
@ -3,8 +3,8 @@ package database
|
||||||
import (
|
import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/query"
|
"github.com/safing/portbase/database/query"
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Maintain runs the Maintain method on all storages.
|
// Maintain runs the Maintain method on all storages.
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/accessor"
|
"github.com/safing/portbase/database/accessor"
|
||||||
)
|
)
|
||||||
|
|
||||||
// And combines multiple conditions with a logical _AND_ operator.
|
// And combines multiple conditions with a logical _AND_ operator.
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/accessor"
|
"github.com/safing/portbase/database/accessor"
|
||||||
)
|
)
|
||||||
|
|
||||||
type boolCondition struct {
|
type boolCondition struct {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package query
|
package query
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Safing/portbase/database/accessor"
|
"github.com/safing/portbase/database/accessor"
|
||||||
)
|
)
|
||||||
|
|
||||||
type errorCondition struct {
|
type errorCondition struct {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/accessor"
|
"github.com/safing/portbase/database/accessor"
|
||||||
)
|
)
|
||||||
|
|
||||||
type existsCondition struct {
|
type existsCondition struct {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/accessor"
|
"github.com/safing/portbase/database/accessor"
|
||||||
)
|
)
|
||||||
|
|
||||||
type floatCondition struct {
|
type floatCondition struct {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/accessor"
|
"github.com/safing/portbase/database/accessor"
|
||||||
)
|
)
|
||||||
|
|
||||||
type intCondition struct {
|
type intCondition struct {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/accessor"
|
"github.com/safing/portbase/database/accessor"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Not negates the supplied condition.
|
// Not negates the supplied condition.
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/accessor"
|
"github.com/safing/portbase/database/accessor"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Or combines multiple conditions with a logical _OR_ operator.
|
// Or combines multiple conditions with a logical _OR_ operator.
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/accessor"
|
"github.com/safing/portbase/database/accessor"
|
||||||
)
|
)
|
||||||
|
|
||||||
type regexCondition struct {
|
type regexCondition struct {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/accessor"
|
"github.com/safing/portbase/database/accessor"
|
||||||
)
|
)
|
||||||
|
|
||||||
type stringCondition struct {
|
type stringCondition struct {
|
||||||
|
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/accessor"
|
"github.com/safing/portbase/database/accessor"
|
||||||
"github.com/Safing/portbase/utils"
|
"github.com/safing/portbase/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type stringSliceCondition struct {
|
type stringSliceCondition struct {
|
||||||
|
|
|
@ -3,7 +3,7 @@ package query
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/accessor"
|
"github.com/safing/portbase/database/accessor"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Condition is an interface to provide a common api to all condition types.
|
// Condition is an interface to provide a common api to all condition types.
|
||||||
|
|
|
@ -4,8 +4,8 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/accessor"
|
"github.com/safing/portbase/database/accessor"
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Example:
|
// Example:
|
||||||
|
|
|
@ -3,8 +3,8 @@ package query
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
"github.com/Safing/portbase/formats/dsd"
|
"github.com/safing/portbase/formats/dsd"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -4,9 +4,9 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/Safing/portbase/container"
|
"github.com/safing/portbase/container"
|
||||||
"github.com/Safing/portbase/database/accessor"
|
"github.com/safing/portbase/database/accessor"
|
||||||
"github.com/Safing/portbase/formats/dsd"
|
"github.com/safing/portbase/formats/dsd"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Base provides a quick way to comply with the Model interface.
|
// Base provides a quick way to comply with the Model interface.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package record
|
package record
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Safing/portbase/formats/dsd"
|
"github.com/safing/portbase/formats/dsd"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Reimport DSD storage types
|
// Reimport DSD storage types
|
||||||
|
|
|
@ -21,11 +21,11 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Safing/portbase/container"
|
"github.com/safing/portbase/container"
|
||||||
"github.com/Safing/portbase/formats/dsd"
|
"github.com/safing/portbase/formats/dsd"
|
||||||
"github.com/Safing/portbase/formats/varint"
|
"github.com/safing/portbase/formats/varint"
|
||||||
// Colfer
|
// Colfer
|
||||||
// "github.com/Safing/portbase/database/model/model"
|
// "github.com/safing/portbase/database/model/model"
|
||||||
// XDR
|
// XDR
|
||||||
// xdr2 "github.com/davecgh/go-xdr/xdr2"
|
// xdr2 "github.com/davecgh/go-xdr/xdr2"
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package record
|
package record
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Safing/portbase/database/accessor"
|
"github.com/safing/portbase/database/accessor"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Record provides an interface for uniformally handling database records.
|
// Record provides an interface for uniformally handling database records.
|
||||||
|
|
|
@ -5,10 +5,10 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/Safing/portbase/container"
|
"github.com/safing/portbase/container"
|
||||||
"github.com/Safing/portbase/database/accessor"
|
"github.com/safing/portbase/database/accessor"
|
||||||
"github.com/Safing/portbase/formats/dsd"
|
"github.com/safing/portbase/formats/dsd"
|
||||||
"github.com/Safing/portbase/formats/varint"
|
"github.com/safing/portbase/formats/varint"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Wrapper wraps raw data and implements the Record interface.
|
// Wrapper wraps raw data and implements the Record interface.
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/Safing/portbase/formats/dsd"
|
"github.com/safing/portbase/formats/dsd"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestWrapper(t *testing.T) {
|
func TestWrapper(t *testing.T) {
|
||||||
|
|
|
@ -7,11 +7,11 @@ import (
|
||||||
|
|
||||||
"github.com/dgraph-io/badger"
|
"github.com/dgraph-io/badger"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/iterator"
|
"github.com/safing/portbase/database/iterator"
|
||||||
"github.com/Safing/portbase/database/query"
|
"github.com/safing/portbase/database/query"
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
"github.com/Safing/portbase/database/storage"
|
"github.com/safing/portbase/database/storage"
|
||||||
"github.com/Safing/portbase/log"
|
"github.com/safing/portbase/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Badger database made pluggable for portbase.
|
// Badger database made pluggable for portbase.
|
||||||
|
|
|
@ -7,8 +7,8 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/query"
|
"github.com/safing/portbase/database/query"
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TestRecord struct {
|
type TestRecord struct {
|
||||||
|
|
|
@ -9,10 +9,10 @@ import (
|
||||||
|
|
||||||
"go.etcd.io/bbolt"
|
"go.etcd.io/bbolt"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/iterator"
|
"github.com/safing/portbase/database/iterator"
|
||||||
"github.com/Safing/portbase/database/query"
|
"github.com/safing/portbase/database/query"
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
"github.com/Safing/portbase/database/storage"
|
"github.com/safing/portbase/database/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -7,8 +7,8 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/query"
|
"github.com/safing/portbase/database/query"
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TestRecord struct {
|
type TestRecord struct {
|
||||||
|
|
|
@ -13,10 +13,10 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/iterator"
|
"github.com/safing/portbase/database/iterator"
|
||||||
"github.com/Safing/portbase/database/query"
|
"github.com/safing/portbase/database/query"
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
"github.com/Safing/portbase/database/storage"
|
"github.com/safing/portbase/database/storage"
|
||||||
"github.com/google/renameio"
|
"github.com/google/renameio"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,9 @@ package storage
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/iterator"
|
"github.com/safing/portbase/database/iterator"
|
||||||
"github.com/Safing/portbase/database/query"
|
"github.com/safing/portbase/database/query"
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package storage
|
package storage
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Safing/portbase/database/iterator"
|
"github.com/safing/portbase/database/iterator"
|
||||||
"github.com/Safing/portbase/database/query"
|
"github.com/safing/portbase/database/query"
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Interface defines the database storage API.
|
// Interface defines the database storage API.
|
||||||
|
|
|
@ -3,10 +3,10 @@ package sinkhole
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/iterator"
|
"github.com/safing/portbase/database/iterator"
|
||||||
"github.com/Safing/portbase/database/query"
|
"github.com/safing/portbase/database/query"
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
"github.com/Safing/portbase/database/storage"
|
"github.com/safing/portbase/database/storage"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Sinkhole is a dummy storage.
|
// Sinkhole is a dummy storage.
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package database
|
package database
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Safing/portbase/database/query"
|
"github.com/safing/portbase/database/query"
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Subscription is a database subscription for updates.
|
// Subscription is a database subscription for updates.
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
|
|
||||||
// "github.com/pkg/bson"
|
// "github.com/pkg/bson"
|
||||||
|
|
||||||
"github.com/Safing/portbase/formats/varint"
|
"github.com/safing/portbase/formats/varint"
|
||||||
)
|
)
|
||||||
|
|
||||||
// define types
|
// define types
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/Safing/portbase/modules"
|
"github.com/safing/portbase/modules"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package log
|
package log
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/Safing/portbase/utils/osdetail"
|
"github.com/safing/portbase/utils/osdetail"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Safing/portbase/taskmanager"
|
"github.com/safing/portbase/taskmanager"
|
||||||
)
|
)
|
||||||
|
|
||||||
func writeLine(line *logLine, duplicates uint64) {
|
func writeLine(line *logLine, duplicates uint64) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/Safing/portbase/log"
|
"github.com/safing/portbase/log"
|
||||||
"github.com/tevino/abool"
|
"github.com/tevino/abool"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
|
|
||||||
"github.com/tevino/abool"
|
"github.com/tevino/abool"
|
||||||
|
|
||||||
"github.com/Safing/portbase/log"
|
"github.com/safing/portbase/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -6,12 +6,12 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database"
|
"github.com/safing/portbase/database"
|
||||||
"github.com/Safing/portbase/database/iterator"
|
"github.com/safing/portbase/database/iterator"
|
||||||
"github.com/Safing/portbase/database/query"
|
"github.com/safing/portbase/database/query"
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
"github.com/Safing/portbase/database/storage"
|
"github.com/safing/portbase/database/storage"
|
||||||
"github.com/Safing/portbase/log"
|
"github.com/safing/portbase/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -3,7 +3,7 @@ package notifications
|
||||||
import (
|
import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/Safing/portbase/modules"
|
"github.com/safing/portbase/modules"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -5,8 +5,8 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/Safing/portbase/database/record"
|
"github.com/safing/portbase/database/record"
|
||||||
"github.com/Safing/portbase/log"
|
"github.com/safing/portbase/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Notification types
|
// Notification types
|
||||||
|
|
|
@ -6,9 +6,9 @@ import (
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/Safing/portbase/info"
|
"github.com/safing/portbase/info"
|
||||||
"github.com/Safing/portbase/log"
|
"github.com/safing/portbase/log"
|
||||||
"github.com/Safing/portbase/modules"
|
"github.com/safing/portbase/modules"
|
||||||
// include packages here
|
// include packages here
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/Safing/portbase/utils/osdetail"
|
"github.com/safing/portbase/utils/osdetail"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue