forked from surrealdb/surrealdb.go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Channel version of panic-fix of surrealdb#135
- Loading branch information
Showing
5 changed files
with
56 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
package conn | ||
|
||
import "github.com/surrealdb/surrealdb.go/pkg/model" | ||
import ( | ||
"errors" | ||
"io" | ||
|
||
"github.com/surrealdb/surrealdb.go/pkg/model" | ||
) | ||
|
||
type Connection interface { | ||
Connect(url string) (Connection, error) | ||
Connect(url string, exitChannel chan error) (Connection, error) | ||
Send(method string, params []interface{}) (interface{}, error) | ||
Close() error | ||
LiveNotifications(id string) (chan model.Notification, error) | ||
} | ||
|
||
var ( | ||
ErrConnectionClosed = errors.New("connection closed") | ||
ErrConnectionNotConnected = errors.New("connection not connected") | ||
ErrTimeout = errors.New("timeout") | ||
ErrClosedPipe = io.ErrClosedPipe | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters