Documentation
¶
Index ¶
- Constants
- Variables
- func BackgroundContext(c context.Context) (context.Context, error)
- func Commit(ctx context.Context) error
- func GetClient(ctx context.Context) (*dgo.Dgraph, error, context.Context)
- func GetEndpoint() string
- func GetGraphQLClient(ctx context.Context) (*graphql.Client, error, context.Context)
- func GetGraphQLEndpoint() string
- func GetGraphQLPort() string
- func GetGrpcPort() string
- func GetHost() string
- func GetTxn(ctx context.Context) *dgo.Txn
- func IdAddPrefix(id string) string
- func IdDecToHex(id string) string
- func IdHexToDec(id string) string
- func IdTrimPrefix(id string) string
- func MigrateSchema(ctx context.Context, fromVersion string, toVersion string) error
- func NewClient() (*dgo.Dgraph, error)
- func NewGraphQLClient() (*graphql.Client, error)
- func Rollback(ctx context.Context) error
- func StartTxn(ctx context.Context, readOnly ...bool) (context.Context, error)
- func ValidId(id string, noPrefix ...bool) bool
Constants ¶
View Source
const ( ENV_HOST = "DGRAPH_DB_HOST" ENV_GRPC_PORT = "DGRAPH_DB_GRPC_PORT" ENV_GRAPHQL_PORT = "DGRAPH_DB_GRAPHQL_PORT" )
View Source
const ( DefaultHost = "localhost" DefaultGrpcPort = "9080" DefaultGraphQLPort = "8080" DgraphAdminTokenHeader = "X-Dgraph-AuthToken" SchemaVersion = "v0.0.1" )
View Source
const ( IdPrefix = "0x" IdPattern = `^[0-9a-fA-F]+$` )
Variables ¶
View Source
var (
IdRegexp = regexp.MustCompile(IdPattern)
)
Functions ¶
func GetEndpoint ¶
func GetEndpoint() string
func GetGraphQLClient ¶
func GetGraphQLEndpoint ¶
func GetGraphQLEndpoint() string
func GetGraphQLPort ¶
func GetGraphQLPort() string
func GetGrpcPort ¶
func GetGrpcPort() string
func IdAddPrefix ¶
func IdDecToHex ¶
func IdHexToDec ¶
func IdTrimPrefix ¶
func MigrateSchema ¶
func NewGraphQLClient ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.