graphdb

package module
v0.0.0-...-2bba41c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

README

[!CAUTION] This project is an independent, community-maintained client for GraphDB.
It is not an official Graphwise/Ontotext project and is provided “as is”, without any warranty or support obligations from Graphwise/Ontotext or its affiliates.

All opinions, code, and documentation here are solely those of the author(s).

go-graphdb

HTTP client for GraphDB

Documentation

Index

Constants

View Source
const (
	PathBackup             = "/rest/recovery/backup"
	PathBackupCloud        = "/rest/recovery/cloud-backup"
	PathBackupRestore      = "/rest/recovery/restore"
	PathBackupRestoreCloud = "/rest/recovery/cloud-restore"
)
View Source
const (
	PathClusterConfig        = "/rest/cluster/config"
	PathClusterConfigNodes   = "/rest/cluster/config/node"
	PathClusterNodeStatus    = "/rest/cluster/node/status"
	PathClusterGroupStatus   = "/rest/cluster/group/status"
	PathClusterTruncateLog   = "/rest/cluster/truncate-log"
	PathClusterTag           = "/rest/cluster/config/tag"
	PathClusterSecondaryMode = "/rest/cluster/config/secondary-mode"
)
View Source
const (
	ClusterAddNodes         = "cluster_add_node"
	ClusterDeleteNodes      = "cluster_delete_node"
	ClusterReplaceNodes     = "cluster_replace_node"
	ClusterCreateConfig     = "cluster_create_config"
	ClusterUpdateConfig     = "cluster_update_config"
	ClusterDeleteConfig     = "cluster_delete_config"
	ClusterGetConfig        = "cluster_get_config"
	ClusterNodeStatus       = "cluster_node_status"
	ClusterGroupStatus      = "cluster_group_status"
	ClusterTruncateLog      = "cluster_truncate_log"
	ClusterAddTag           = "cluster_add_tag"
	ClusterRemoveTag        = "cluster_remove_tag"
	ClusterEnableSecondary  = "cluster_enable_secondary"
	ClusterDisableSecondary = "cluster_disable_secondary"
)
View Source
const (
	PathMonitorStructs    = "/rest/monitor/structures"
	PathMonitorInfra      = "/rest/monitor/infrastructure"
	PathMonitorCluster    = "/rest/monitor/cluster"
	PathMonitorRecovery   = "/rest/monitor/backup"
	PathMonitorRepository = "/rest/monitor/repository/%s"
)
View Source
const (
	PathProtocol     = "/protocol"
	PathTransactions = "/repositories/%s/transactions"
	PathTransaction  = "/repositories/%s/transactions/%s"
)
View Source
const (
	PathReport       = "/rest/report"
	PathReportStatus = "/rest/report/status"

	StateNone       = "NONE"
	StateInProgress = "IN_PROGRESS"
	StateReady      = "READY"
	StateError      = "ERROR"
)
View Source
const (
	PathRepositories                  = "/rest/repositories"
	PathRepository                    = PathRepositories + "/%s"
	PathRepositorySize                = PathRepository + "/size"
	PathRepositoryRestart             = PathRepository + "/restart"
	PathRepositoryImport              = PathRepository + "/import"
	PathRepositoryImportServer        = PathRepositoryImport + "/server"
	PathRepositorySparqlTemplates     = PathRepository + "/sparql-templates"
	PathRepositorySparqlTemplatesExec = PathRepository + "/sparql-templates/execute"
	PathRepositorySparqlTemplatesConf = PathRepository + "/sparql-templates/configuration"

	PathSqlViews      = "/rest/sql-views/tables"
	PathSqlViewsTable = "/rest/sql-views/tables/%s"
)
View Source
const (
	PathLogin              = "/rest/login"
	PathSecurity           = "/rest/security"
	PathSecurityFreeAccess = "/rest/security/free-access"
	PathSecurityUsers      = "/rest/security/users"
	PathSecurityUser       = "/rest/security/users/%s"
	PathCustomRoles        = "/rest/security/custom-roles"
	PathCustomRole         = "/rest/security/custom-roles/%s"
)
View Source
const (
	PathAccessControlLists = "/rest/repositories/%s/acl"
)
View Source
const (
	PathLocations = "/rest/locations"
)
View Source
const (
	PathSavedQueries = "/rest/sparql/saved-queries"
)
View Source
const (
	PathVersion = "/rest/info/version"
)

Variables

View Source
var (
	ErrNotFound     = errors.New("not found")
	ErrUnauthorized = errors.New("unauthorized")
	ErrForbidden    = errors.New("forbidden")
)

Functions

func ErrNotStatus

func ErrNotStatus(status int, message string, resp *http.Response) error

Types

type AclClient

type AclClient struct {
	// contains filtered or unexported fields
}

func (*AclClient) Add

func (a *AclClient) Add(ctx context.Context, id string, policies []Policy, conf ...RequestConfig) error

func (*AclClient) Delete

func (a *AclClient) Delete(ctx context.Context, id string, policies []Policy, conf ...RequestConfig) error

func (*AclClient) List

func (a *AclClient) List(ctx context.Context, id string, conf ...RequestConfig) error

func (*AclClient) Replace

func (a *AclClient) Replace(ctx context.Context, id string, policies []Policy, conf ...RequestConfig) error

type BackupClient

type BackupClient struct {
	// contains filtered or unexported fields
}

func (*BackupClient) Create

func (b *BackupClient) Create(ctx context.Context, opts BackupOptions, consumer func(filename string, reader io.Reader) error) error

Create request for a new backup to be created. If BackupOptions.BucketUri is not set, the backup will be provided, to the consumer function. If bucket URI is set, the consumer function is not called and can be nil.

func (*BackupClient) Restore

func (b *BackupClient) Restore(ctx context.Context, opts RestoreOptions, r io.Reader) error

type BackupOptions

type BackupOptions struct {
	BucketUri        string   `json:"bucketUri,omitempty"`
	BackupSystemData bool     `json:"backupSystemData,omitempty"`
	Repositories     []string `json:"repositories,omitempty"`
}

type ClearGraphEntry

type ClearGraphEntry struct {
	SystemPolicy
	Context string `json:"context,omitempty"`
}

func (ClearGraphEntry) PolicyType

func (s ClearGraphEntry) PolicyType() string

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(url string, opts ...Option) *Client

func (*Client) Backups

func (c *Client) Backups() *BackupClient

func (*Client) Cluster

func (c *Client) Cluster() *ClusterClient

func (*Client) Info

func (c *Client) Info() *InfoClient

func (*Client) Locations

func (c *Client) Locations() *LocationClient

func (*Client) Monitoring

func (c *Client) Monitoring() *MonitoringClient

func (*Client) RDF4J

func (c *Client) RDF4J() *RDF4J

func (*Client) Report

func (c *Client) Report() *ReportClient

func (*Client) Repositories

func (c *Client) Repositories() *RepositoryClient

func (*Client) SavedQueries

func (c *Client) SavedQueries() *SavedQueriesClient

func (*Client) Security

func (c *Client) Security() *SecurityClient

type ClusterClient

type ClusterClient struct {
	// contains filtered or unexported fields
}

func (*ClusterClient) AddNodes

func (c *ClusterClient) AddNodes(ctx context.Context, nodes []string, config ...RequestConfig) (map[string]string, error)

func (*ClusterClient) AddTag

func (c *ClusterClient) AddTag(ctx context.Context, tag string, config ...RequestConfig) error

func (*ClusterClient) Config

func (c *ClusterClient) Config(ctx context.Context, config ...RequestConfig) (ClusterConfig, error)

func (*ClusterClient) Create

func (c *ClusterClient) Create(ctx context.Context, cc ClusterConfig, config ...RequestConfig) (map[string]string, error)

func (*ClusterClient) Delete

func (c *ClusterClient) Delete(ctx context.Context, config ...RequestConfig) error

func (*ClusterClient) DeleteNodes

func (c *ClusterClient) DeleteNodes(ctx context.Context, nodes []string, config ...RequestConfig) (map[string]string, error)

func (*ClusterClient) DisableSecondaryMode

func (c *ClusterClient) DisableSecondaryMode(ctx context.Context, config ...RequestConfig) error

func (*ClusterClient) EnableSecondaryMode

func (c *ClusterClient) EnableSecondaryMode(ctx context.Context, primary, tag string, config ...RequestConfig) error

func (*ClusterClient) NodeStatus

func (c *ClusterClient) NodeStatus(ctx context.Context, config ...RequestConfig) (NodeStatus, error)

func (*ClusterClient) RemoveTag

func (c *ClusterClient) RemoveTag(ctx context.Context, tag string, config ...RequestConfig) error

func (*ClusterClient) ReplaceNodes

func (c *ClusterClient) ReplaceNodes(ctx context.Context, add []string, remove []string, config ...RequestConfig) (map[string]string, error)

func (*ClusterClient) Status

func (c *ClusterClient) Status(ctx context.Context, config ...RequestConfig) ([]NodeStatus, error)

func (*ClusterClient) Truncate

func (c *ClusterClient) Truncate(ctx context.Context, config ...RequestConfig) error

func (*ClusterClient) Update

func (c *ClusterClient) Update(ctx context.Context, props ClusterProperties, config ...RequestConfig) (ClusterConfig, error)

type ClusterConfig

type ClusterConfig struct {
	ClusterProperties
	Nodes []string `json:"nodes,omitempty"`
}

type ClusterError

type ClusterError struct {
	Op       string
	NotFound bool
	Messages StringSliceMap
	Err      error
}

func (ClusterError) Error

func (c ClusterError) Error() string

func (ClusterError) Unwrap

func (c ClusterError) Unwrap() error

type ClusterProperties

type ClusterProperties struct {
	ElectionMinTimeout          int     `json:"electionMinTimeout,omitempty"`
	ElectionRangeTimeout        int     `json:"electionRangeTimeout,omitempty"`
	HeartbeatInterval           int     `json:"heartbeatInterval,omitempty"`
	MessageSizeKB               int     `json:"messageSizeKB,omitempty"`
	VerificationTimeout         int     `json:"verificationTimeout,omitempty"`
	TransactionLogMaximumSizeGB float32 `json:"transactionLogMaximumSizeGB,omitempty"`
	BatchUpdateInterval         int     `json:"batchUpdateInterval,omitempty"`
}

type ClusterStats

type ClusterStats struct {
	Term               int `json:"term,omitempty"`
	FailedRecoveries   int `json:"failureRecoveriesCount,omitempty"`
	FailedTransactions int `json:"failedTransactionsCount,omitempty"`
}

type DiskStats

type DiskStats struct {
	DataDirUsed int `json:"dataDirUsed,omitempty"`
	WorkDirUsed int `json:"workDirUsed,omitempty"`
	LogsDirUsed int `json:"logsDirUsed,omitempty"`
	DataDirFree int `json:"dataDirFree,omitempty"`
	WorkDirFree int `json:"workDirFree,omitempty"`
	LogsDirFree int `json:"logsDirFree,omitempty"`
}

type EpoolStats

type EpoolStats struct {
	Reads  int `json:"epoolReads,omitempty"`
	Writes int `json:"epoolWrites,omitempty"`
	Size   int `json:"epoolSize,omitempty"`
}

type FreeAccess

type FreeAccess struct {
	Enabled     bool            `json:"enabled,omitempty"`
	Authorities []string        `json:"authorities,omitempty"`
	AppSettings map[string]bool `json:"appSettings,omitempty"`
}

func (*FreeAccess) ReadRepos

func (f *FreeAccess) ReadRepos(repos ...string)

func (*FreeAccess) WriteRepos

func (f *FreeAccess) WriteRepos(repos ...string)

type ImportSettings

type ImportSettings struct {
	Name                   string         `json:"name"`
	Status                 string         `json:"status"`
	Message                string         `json:"message"`
	Context                string         `json:"context"`
	ReplaceGraphs          []string       `json:"replaceGraphs"`
	BaseURI                string         `json:"baseURI"`
	ForceSerial            bool           `json:"forceSerial"`
	Type                   string         `json:"type"`
	Format                 string         `json:"format"`
	Data                   string         `json:"data"`
	ParserSettings         ParserSettings `json:"parserSettings"`
	Size                   string         `json:"size"`
	LastModified           int            `json:"lastModified"`
	Imported               int            `json:"imported"`
	AddedStatements        int            `json:"addedStatements"`
	RemovedStatements      int            `json:"removedStatements"`
	NumReplacedGraphs      int            `json:"numReplacedGraphs"`
	FileSize               int            `json:"fileSize"`
	FileLastModified       string         `json:"fileLastModified"`
	AddedRemovedStatements int            `json:"addedRemovedStatements"`
}

type InfoClient

type InfoClient struct {
	// contains filtered or unexported fields
}

func (*InfoClient) Version

func (i *InfoClient) Version(ctx context.Context, conf ...RequestConfig) (VersionInfo, error)

type InfraStats

type InfraStats struct {
	Heap                MemoryStats `json:"heapMemoryUsage,omitempty"`
	OffHeap             MemoryStats `json:"nonHeapMemoryUsage,omitempty"`
	Disk                DiskStats   `json:"storageMemory,omitempty"`
	ThreadCount         int         `json:"threadCount,omitempty"`
	CpuLoad             int         `json:"cpuLoad,omitempty"`
	ClassCount          int         `json:"classCount,omitempty"`
	GcCount             int         `json:"gcCount,omitempty"`
	OpenFileDescriptors int         `json:"openFileDescriptors,omitempty"`
	MaxFileDescriptors  int         `json:"maxFileDescriptors,omitempty"`
}

type IntString

type IntString struct {
	// contains filtered or unexported fields
}

func (*IntString) IsZero

func (is *IntString) IsZero() bool

func (*IntString) MarshalJSON

func (is *IntString) MarshalJSON() ([]byte, error)

func (*IntString) UnmarshalJSON

func (is *IntString) UnmarshalJSON(data []byte) error

type LicenseInfo

type LicenseInfo struct {
	Version               string   `json:"version,omitempty"`
	Valid                 bool     `json:"valid,omitempty"`
	Message               string   `json:"message,omitempty"`
	InstallationId        string   `json:"installationId,omitempty"`
	Licensee              string   `json:"licensee,omitempty"`
	Product               string   `json:"product,omitempty"`
	TypeOfUse             string   `json:"typeOfUse,omitempty"`
	MaxCpuCores           int      `json:"maxCpuCores,omitempty"`
	ExpiryDate            string   `json:"expiryDate,omitempty"`
	LatestPublicationDate int64    `json:"latestPublicationDate,omitempty"`
	LicenseCapabilities   []string `json:"licenseCapabilities,omitempty"`
	ProductType           string   `json:"productType,omitempty"`
}

type Location

type Location struct {
	Uri               string `json:"uri,omitempty"`
	Label             string `json:"label,omitempty"`
	Username          string `json:"username,omitempty"`
	Password          string `json:"password,omitempty"`
	AuthType          string `json:"authType,omitempty"`
	LocationType      string `json:"locationType,omitempty"`
	Active            bool   `json:"active,omitempty"`
	Local             bool   `json:"local,omitempty"`
	System            bool   `json:"system,omitempty"`
	ErrorMsg          string `json:"errorMsg,omitempty"`
	DefaultRepository string `json:"defaultRepository,omitempty"`
}

type LocationClient

type LocationClient struct {
	// contains filtered or unexported fields
}

func (*LocationClient) Add

func (l *LocationClient) Add(ctx context.Context, location Location, conf ...RequestConfig) error

func (*LocationClient) Delete

func (l *LocationClient) Delete(ctx context.Context, uri string, conf ...RequestConfig) error

func (*LocationClient) List

func (l *LocationClient) List(ctx context.Context, conf ...RequestConfig) ([]Location, error)

func (*LocationClient) Update

func (l *LocationClient) Update(ctx context.Context, location Location, conf ...RequestConfig) error

type MemoryStats

type MemoryStats struct {
	Max       int `json:"max,omitempty"`
	Committed int `json:"committed,omitempty"`
	Init      int `json:"init,omitempty"`
	Used      int `json:"used,omitempty"`
}

type MonitoringClient

type MonitoringClient struct {
	// contains filtered or unexported fields
}

func (*MonitoringClient) Cluster

func (m *MonitoringClient) Cluster(ctx context.Context, conf ...RequestConfig) (ClusterStats, error)

func (*MonitoringClient) Infrastructure

func (m *MonitoringClient) Infrastructure(ctx context.Context, conf ...RequestConfig) (InfraStats, error)

func (*MonitoringClient) PageCache

func (m *MonitoringClient) PageCache(ctx context.Context, conf ...RequestConfig) (PageCacheStats, error)

func (*MonitoringClient) Recovery

func (m *MonitoringClient) Recovery(ctx context.Context, conf ...RequestConfig) (RecoveryStats, error)

func (*MonitoringClient) Repository

func (m *MonitoringClient) Repository(ctx context.Context, id string, conf ...RequestConfig) (RepositoryStats, error)

type NodeStats

type NodeStats struct {
	Total        int `json:"nodesInCluster,omitempty"`
	InSync       int `json:"nodesInSync,omitempty"`
	OutOfSync    int `json:"nodesOutOfSync,omitempty"`
	Disconnected int `json:"nodesDisconnected,omitempty"`
	Syncing      int `json:"nodesSyncing,omitempty"`
}

type NodeStatus

type NodeStatus struct {
	ClusterEnabled bool              `json:"clusterEnabled,omitempty"`
	Address        string            `json:"address,omitempty"`
	NodeState      string            `json:"nodeState,omitempty"`
	Term           int               `json:"term,omitempty"`
	SyncStatus     map[string]string `json:"syncStatus,omitempty"`
	LastLogTerm    int               `json:"lastLogTerm,omitempty"`
	LastLogIndex   int               `json:"lastLogIndex,omitempty"`
	Endpoint       string            `json:"endpoint,omitempty"`
	RecoveryStatus RecoveryStatus    `json:"recoveryStatus,omitempty"`
	TopologyStatus TopologyStatus    `json:"topologyStatus,omitempty"`
}

type Option

type Option func(client *Client)

func WithBasicAuth

func WithBasicAuth(username, password string) Option

func WithTransport

func WithTransport(transport http.RoundTripper) Option

type PageCacheStats

type PageCacheStats struct {
	Hits   int `json:"cacheHit,omitempty"`
	Misses int `json:"cacheMiss,omitempty"`
}

type ParserSettings

type ParserSettings struct {
	PreserveBNodeIds          bool   `json:"preserveBNodeIds"`
	FailOnUnknownDataTypes    bool   `json:"failOnUnknownDataTypes"`
	VerifyDataTypeValues      bool   `json:"verifyDataTypeValues"`
	NormalizeDataTypeValues   bool   `json:"normalizeDataTypeValues"`
	FailOnUnknownLanguageTags bool   `json:"failOnUnknownLanguageTags"`
	VerifyLanguageTags        bool   `json:"verifyLanguageTags"`
	NormalizeLanguageTags     bool   `json:"normalizeLanguageTags"`
	StopOnError               bool   `json:"stopOnError"`
	ContextLink               string `json:"contextLink"`
}

type Part

type Part struct {
	Key      string
	Type     string
	Filename string
	Value    io.Reader
}

func (*Part) ContentType

func (p *Part) ContentType() string

type PluginPolicy

type PluginPolicy struct {
	SystemPolicy
	Plugin string `json:"plugin,omitempty"`
}

func (PluginPolicy) PolicyType

func (s PluginPolicy) PolicyType() string

type Policy

type Policy interface {
	PolicyType() string
}

type QueryStats

type QueryStats struct {
	Slow       int `json:"slow,omitempty"`
	Suboptimal int `json:"suboptimal,omitempty"`
}

type RDF4J

type RDF4J struct {
	// contains filtered or unexported fields
}

func (*RDF4J) Protocol

func (r *RDF4J) Protocol(ctx context.Context, config ...RequestConfig) (string, error)

type RecoveryConfigStats

type RecoveryConfigStats struct {
	WithRepositoryData bool     `json:"withRepositoryData,omitempty"`
	WithSystemData     bool     `json:"withSystemData,omitempty"`
	CleanDataDir       bool     `json:"cleanDataDir,omitempty"`
	Repositories       []string `json:"repositories,omitempty"`
}

type RecoveryState

type RecoveryState struct {
	Name    string `json:"name"`
	Message string `json:"message"`
}

type RecoveryStats

type RecoveryStats struct {
	Id                   string              `json:"id,omitempty"`
	Username             string              `json:"username,omitempty"`
	Operation            string              `json:"operation,omitempty"`
	AffectedRepositories []string            `json:"affectedRepositories,omitempty"`
	RunningFor           int                 `json:"msSinceCreated,omitempty"`
	Node                 string              `json:"nodePerformingClusterBackup,omitempty"`
	Options              RecoveryConfigStats `json:"snapshotOptions,omitempty"`
}

type RecoveryStatus

type RecoveryStatus struct {
	State         RecoveryState `json:"state,omitempty"`
	AffectedNodes []string      `json:"affectedNodes,omitempty"`
	Message       string        `json:"message,omitempty"`
}

type ReportClient

type ReportClient struct {
	// contains filtered or unexported fields
}

func (*ReportClient) Download

func (r *ReportClient) Download(ctx context.Context, consumer func(filename string, r io.Reader) error, config ...RequestConfig) error

func (*ReportClient) Generate

func (r *ReportClient) Generate(ctx context.Context, config ...RequestConfig) (bool, error)

func (*ReportClient) Status

func (r *ReportClient) Status(ctx context.Context, config ...RequestConfig) (ReportStatus, error)

type ReportStatus

type ReportStatus struct {
	State      string
	Time       time.Time
	ErrMessage string
}

type RepositoryClient

type RepositoryClient struct {
	// contains filtered or unexported fields
}

func (*RepositoryClient) CancelServerFile

func (r *RepositoryClient) CancelServerFile(ctx context.Context, id string, file string, conf ...RequestConfig) error

func (*RepositoryClient) Create

func (r *RepositoryClient) Create(ctx context.Context, config RequestConfig, other ...RequestConfig) error

func (*RepositoryClient) CreateSparqlTemplates

func (r *RepositoryClient) CreateSparqlTemplates(ctx context.Context, repo, template SparqlTemplate, conf ...RequestConfig) error

func (*RepositoryClient) CreateSqlView

func (r *RepositoryClient) CreateSqlView(ctx context.Context, repo string, view SqlView, conf ...RequestConfig) error

func (*RepositoryClient) Delete

func (r *RepositoryClient) Delete(ctx context.Context, id string, conf ...RequestConfig) error

func (*RepositoryClient) DeleteSparqlTemplates

func (r *RepositoryClient) DeleteSparqlTemplates(ctx context.Context, repo, template string, conf ...RequestConfig) error

func (*RepositoryClient) DeleteSqlView

func (r *RepositoryClient) DeleteSqlView(ctx context.Context, repo string, view string, conf ...RequestConfig) error

func (*RepositoryClient) Edit

func (r *RepositoryClient) Edit(ctx context.Context, id string, config RepositoryConfig, other ...RequestConfig) error

func (*RepositoryClient) ImportServerFiles

func (r *RepositoryClient) ImportServerFiles(ctx context.Context, id string, files []string, settings ImportSettings, conf ...RequestConfig) error

func (*RepositoryClient) Infos

func (r *RepositoryClient) Infos(ctx context.Context, conf ...RequestConfig) ([]RepositoryInfo, error)

func (*RepositoryClient) Restart

func (r *RepositoryClient) Restart(ctx context.Context, id string, conf ...RequestConfig) error

func (*RepositoryClient) RunSparqlTemplates

func (r *RepositoryClient) RunSparqlTemplates(ctx context.Context, repo string, params map[string]interface{}, consumer func(r io.Reader) error, conf ...RequestConfig) error

func (*RepositoryClient) ServerFiles

func (r *RepositoryClient) ServerFiles(ctx context.Context, id string, conf ...RequestConfig) ([]ImportSettings, error)

func (*RepositoryClient) Size

func (*RepositoryClient) SparqlTemplate

func (r *RepositoryClient) SparqlTemplate(ctx context.Context, repo, template string, conf ...RequestConfig) (SparqlTemplate, error)

func (*RepositoryClient) SparqlTemplates

func (r *RepositoryClient) SparqlTemplates(ctx context.Context, repo string, conf ...RequestConfig) ([]string, error)

func (*RepositoryClient) SqlView

func (r *RepositoryClient) SqlView(ctx context.Context, repo, view string, conf ...RequestConfig) (SqlView, error)

func (*RepositoryClient) SqlViews

func (r *RepositoryClient) SqlViews(ctx context.Context, repo string, conf ...RequestConfig) ([]string, error)

func (*RepositoryClient) UpdateSparqlTemplates

func (r *RepositoryClient) UpdateSparqlTemplates(ctx context.Context, repo string, template SparqlTemplate, conf ...RequestConfig) error

func (*RepositoryClient) UpdateSqlView

func (r *RepositoryClient) UpdateSqlView(ctx context.Context, repo string, view SqlView, conf ...RequestConfig) error

type RepositoryConfig

type RepositoryConfig struct {
	Id         string                               `json:"id,omitempty"`
	Title      string                               `json:"title,omitempty"`
	Type       string                               `json:"type,omitempty"`
	SesameType string                               `json:"sesameType,omitempty"`
	Location   string                               `json:"location,omitempty"`
	Params     map[string]RepositoryConfigParameter `json:"params,omitempty"`
}

type RepositoryConfigParameter

type RepositoryConfigParameter struct {
	Name  string     `json:"name,omitempty"`
	Label string     `json:"label,omitempty"`
	Value *IntString `json:"value,omitempty"`
}

type RepositoryInfo

type RepositoryInfo struct {
	Id          string `json:"id"`
	Title       string `json:"title"`
	Uri         string `json:"uri"`
	ExternalUrl string `json:"externalUrl"`
	Local       bool   `json:"local"`
	Type        string `json:"type"`
	SesameType  string `json:"sesameType"`
	Location    string `json:"location"`
	Readable    bool   `json:"readable"`
	Writable    bool   `json:"writable"`
	Unsupported bool   `json:"unsupported"`
	State       string `json:"state"`
}

type RepositorySize

type RepositorySize struct {
	Inferred int `json:"inferred"`
	Total    int `json:"total"`
	Explicit int `json:"explicit"`
}

type RepositoryStats

type RepositoryStats struct {
	Queries            QueryStats `json:"queries,omitempty"`
	EntityPool         EpoolStats `json:"entityPool,omitempty"`
	ActiveTransactions int        `json:"activeTransactions,omitempty"`
	OpenConnections    int        `json:"openConnections,omitempty"`
}

type RequestConfig

type RequestConfig func(req *http.Request)
func Header(key, val string) RequestConfig

func JsonBody

func JsonBody(v any) RequestConfig

func MultipartFormData

func MultipartFormData(parts ...Part) RequestConfig

func Query

func Query(key, val string) RequestConfig

type ResponseHandler

type ResponseHandler func(resp *http.Response) error

func CombinedResponseHandler

func CombinedResponseHandler(handlers ...ResponseHandler) ResponseHandler

CombinedResponseHandler creates a single response handler from multiple. It iterates all handlers, but stops on the first one that returns an error, returning that error to the caller. Useful for combining error checkers and response parsers.

func ExpectOneOfStatusCode

func ExpectOneOfStatusCode(codes ...int) ResponseHandler

func ExpectStatusCode

func ExpectStatusCode(code int) ResponseHandler

func UnmarshalJson

func UnmarshalJson(v any) ResponseHandler

type RestoreOptions

type RestoreOptions struct {
	BucketUri               string   `json:"bucketUri,omitempty"`
	RestoreSystemData       bool     `json:"restoreSystemData,omitempty"`
	RemoveStaleRepositories bool     `json:"removeStaleRepositories,omitempty"`
	Repositories            []string `json:"repositories,omitempty"`
}

type SavedQueriesClient

type SavedQueriesClient struct {
	// contains filtered or unexported fields
}

func (*SavedQueriesClient) CreateSavedQueries

func (s *SavedQueriesClient) CreateSavedQueries(ctx context.Context, query SavedQuery, conf ...RequestConfig) error

func (*SavedQueriesClient) DeleteSavedQueries

func (s *SavedQueriesClient) DeleteSavedQueries(ctx context.Context, name string, conf ...RequestConfig) error

func (*SavedQueriesClient) SavedQueries

func (s *SavedQueriesClient) SavedQueries(ctx context.Context, conf ...RequestConfig) ([]SavedQuery, error)

func (*SavedQueriesClient) UpdateSavedQueries

func (s *SavedQueriesClient) UpdateSavedQueries(ctx context.Context, name string, query SavedQuery, conf ...RequestConfig) error

type SavedQuery

type SavedQuery struct {
	Name   string `json:"name,omitempty"`
	Body   string `json:"body,omitempty"`
	Shared bool   `json:"shared,omitempty"`
}

type SecurityClient

type SecurityClient struct {
	// contains filtered or unexported fields
}

func (*SecurityClient) AddCustomRoleUsers

func (s *SecurityClient) AddCustomRoleUsers(ctx context.Context, role string, users []string, config ...RequestConfig) error

func (*SecurityClient) ConfigureFreeAccess

func (s *SecurityClient) ConfigureFreeAccess(ctx context.Context, access FreeAccess, config ...RequestConfig) error

func (*SecurityClient) CreateUser

func (s *SecurityClient) CreateUser(ctx context.Context, user User, config ...RequestConfig) error

func (*SecurityClient) DeleteUser

func (s *SecurityClient) DeleteUser(ctx context.Context, username string, config ...RequestConfig) error

func (*SecurityClient) Enabled

func (s *SecurityClient) Enabled(ctx context.Context, config ...RequestConfig) (bool, error)

func (*SecurityClient) FreeAccess

func (s *SecurityClient) FreeAccess(ctx context.Context, config ...RequestConfig) (FreeAccess, error)

func (*SecurityClient) GetCustomRoleUsers

func (s *SecurityClient) GetCustomRoleUsers(ctx context.Context, role string, config ...RequestConfig) ([]string, error)

func (*SecurityClient) GetCustomRoles

func (s *SecurityClient) GetCustomRoles(ctx context.Context, config ...RequestConfig) (map[string]string, error)

func (*SecurityClient) Login

func (s *SecurityClient) Login(ctx context.Context, username, password string, config ...RequestConfig) (string, UserDetails, error)

func (*SecurityClient) RemoveCustomRoleUsers

func (s *SecurityClient) RemoveCustomRoleUsers(ctx context.Context, role string, users []string, config ...RequestConfig) error

func (*SecurityClient) ReplaceCustomRoleUsers

func (s *SecurityClient) ReplaceCustomRoleUsers(ctx context.Context, role string, users []string, config ...RequestConfig) error

func (*SecurityClient) ReplaceCustomRoles

func (s *SecurityClient) ReplaceCustomRoles(ctx context.Context, roles map[string][]string, config ...RequestConfig) error

func (*SecurityClient) SetEnabled

func (s *SecurityClient) SetEnabled(ctx context.Context, enabled bool, config ...RequestConfig) error

func (*SecurityClient) UpdateUser

func (s *SecurityClient) UpdateUser(ctx context.Context, user User, config ...RequestConfig) error

func (*SecurityClient) UpdateUserSettings

func (s *SecurityClient) UpdateUserSettings(ctx context.Context, user User, config ...RequestConfig) error

func (*SecurityClient) User

func (s *SecurityClient) User(ctx context.Context, username string, config ...RequestConfig) (User, error)

func (*SecurityClient) Users

func (s *SecurityClient) Users(ctx context.Context, config ...RequestConfig) ([]User, error)

type SparqlTemplate

type SparqlTemplate struct {
	Id    string `json:"id,omitempty"`
	Query string `json:"query,omitempty"`
}

type SqlColumn

type SqlColumn struct {
	Name             string `json:"column_name,omitempty"`
	Type             string `json:"column_type,omitempty"`
	SqlTypePrecision int    `json:"sql_type_precision,omitempty"`
	SqlTypeScale     int    `json:"sql_type_scale,omitempty"`
	Nullable         bool   `json:"nullable,omitempty"`
	SparqlType       string `json:"sparql_type,omitempty"`
}

type SqlView

type SqlView struct {
	Name    string    `json:"name,omitempty"`
	Query   string    `json:"query,omitempty"`
	Columns SqlColumn `json:"columns,omitempty"`
}

type StatementStatement

type StatementStatement struct {
	SystemPolicy
	Subject   string `json:"subject,omitempty"`
	Predicate string `json:"predicate,omitempty"`
	Object    string `json:"object,omitempty"`
	Context   string `json:"context,omitempty"`
}

func (StatementStatement) PolicyType

func (s StatementStatement) PolicyType() string

type StringSlice

type StringSlice []string

StringSlice is a slice of strings, but can unmarshal from a single string json literal.

func (*StringSlice) UnmarshalJSON

func (s *StringSlice) UnmarshalJSON(data []byte) error

type StringSliceMap

type StringSliceMap struct {
	// contains filtered or unexported fields
}

func (*StringSliceMap) IsList

func (s *StringSliceMap) IsList() bool

func (*StringSliceMap) List

func (s *StringSliceMap) List() []string

func (*StringSliceMap) Map

func (s *StringSliceMap) Map() map[string]string

func (*StringSliceMap) UnmarshalJSON

func (s *StringSliceMap) UnmarshalJSON(data []byte) error

type SystemPolicy

type SystemPolicy struct {
	PolicyName string `json:"policy,omitempty"`
	Role       string `json:"role,omitempty"`
	Scope      string `json:"scope,omitempty"`
	Operation  string `json:"operation,omitempty"`
}

func (SystemPolicy) PolicyType

func (s SystemPolicy) PolicyType() string

type TopologyStatus

type TopologyStatus struct {
	State         string         `json:"state,omitempty"`
	PrimaryTags   map[string]int `json:"primaryTags,omitempty"`
	PrimaryIndex  int            `json:"primaryIndex,omitempty"`
	PrimaryLeader string         `json:"primaryLeader,omitempty"`
}

type User

type User struct {
	Username           string          `json:"username,omitempty"`
	Password           string          `json:"password,omitempty"`
	GrantedAuthorities []string        `json:"grantedAuthorities,omitempty"`
	AppSettings        map[string]bool `json:"appSettings,omitempty"`
	DateCreated        int64           `json:"dateCreated,omitempty"`
	GptThreads         []interface{}   `json:"gptThreads,omitempty"`
}

type UserDetails

type UserDetails struct {
	Username    string          `json:"username,omitempty"`
	Password    string          `json:"password,omitempty"`
	Authorities []string        `json:"authorities,omitempty"`
	AppSettings map[string]bool `json:"appSettings,omitempty"`
	External    bool            `json:"external,omitempty"`
}

type VersionInfo

type VersionInfo struct {
	Product    string `json:"productType,omitempty"`
	Version    string `json:"productVersion,omitempty"`
	Connectors string `json:"connectors,omitempty"`
	Sesame     string `json:"sesame,omitempty"`
	Workbench  string `json:"Workbench,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL