api

package
v1.98.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperationStatusInProgress = "InProgress"
	OperationStatusCompleted  = "Completed"
	OperationStatusFaulted    = "Faulted"
)
View Source
const (
	CounterOperationTypeIncrement = CounterOperationType("Increment")
	CounterOperationTypeDelete    = CounterOperationType("Delete")
	CounterOperationTypeGet       = CounterOperationType("Get")
)
View Source
const DateTimeFormat = "2006-01-02T15:04:05.0000000Z"

DateTimeFormat to send & receive from RavenDB. Nanoseconds are important or comparisons and index operations will fail in mysterious ways. Zeros for the nanoseconds is bad on purpose to avoid formatting them.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchCommand

type BatchCommand interface {
	// contains filtered or unexported methods
}

type BulkCommands

type BulkCommands struct {
	Commands []BatchCommand
}

type Counter

type Counter struct {
	DocumentID  string `json:"DocumentId"`
	CounterName string
	TotalValue  int64
}

type CounterOperation

type CounterOperation struct {
	CounterName string
	Delta       int64
	Type        CounterOperationType
}

type CounterOperationDocument

type CounterOperationDocument struct {
	DocumentID string `json:"DocumentId"`
	Operations []*CounterOperation
}

type CounterOperationType

type CounterOperationType string

type CounterOperations

type CounterOperations struct {
	Documents []*CounterOperationDocument
}

type Counters

type Counters struct {
	Counters []*Counter
}

type Database

type Database struct {
	DatabaseName  string
	DatabaseState string `json:",omitempty"`
	Disabled      bool   `json:",omitempty"`
	DataDirectory string `json:",omitempty"`
	Indexes       map[string]*Index
	Revisions     *Revisions
}

type DeleteCommand

type DeleteCommand struct {
	ID           string  `json:"Id,omitempty"`
	ChangeVector *string `json:",omitempty"`

	// Always set to "DELETE"
	Type string
}

type DeletePrefixCommand

type DeletePrefixCommand struct {
	ID string `json:"ID"`

	// Always set to true
	IDPrefixed bool `json:"IdPrefixed"`

	// Always set to "DELETE"
	Type string
}

type DocsRequest added in v1.87.2

type DocsRequest struct {
	IDs []string `json:"Ids"`
}

type Duration

type Duration time.Duration

func (Duration) MarshalJSON

func (duration Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON

func (duration *Duration) UnmarshalJSON(data []byte) error

type Index

type Index struct {
	Type                     string
	Name                     string
	Maps                     []string
	Reduce                   *string
	Fields                   map[string]*IndexFieldOptions
	OutputReduceToCollection *string
	AdditionalSources        map[string]string
}

func (*Index) FieldOrCreate

func (index *Index) FieldOrCreate(name string) *IndexFieldOptions

type IndexFieldOptions

type IndexFieldOptions struct {
	Indexing string `json:",omitempty"`
	Storage  string `json:",omitempty"`
}

type IndexesRequest

type IndexesRequest struct {
	Indexes []*Index
}

type ModelMetadata

type ModelMetadata struct {
	ID           string `json:"Id"`
	ChangeVector string
	Expires      time.Time
}

type Operation

type Operation struct {
	ID int64 `json:"OperationId"`
}

type OperationProgress

type OperationProgress struct {
	Processed int64
	Total     int64
}

type OperationResult

type OperationResult struct {
	Total int64

	// Only filled if it fails
	Message string
	Error   string
}

type OperationStatus

type OperationStatus struct {
	Status   string
	Progress *OperationProgress
	Result   *OperationResult
}

type Patch

type Patch struct {
	Query *Query
}

type PutCommand

type PutCommand struct {
	ID           string `json:"Id,omitempty"`
	ChangeVector *string
	Document     interface{}

	// Always set to "PUT"
	Type string
}

type Query

type Query struct {
	Query                         string
	QueryParameters               map[string]interface{} `json:",omitempty"`
	WaitForNonStaleResults        bool                   `json:",omitempty"`
	WaitForNonStaleResultsTimeout string                 `json:",omitempty"`
}

type Result

type Result map[string]interface{}

func (Result) DirectMetadata

func (result Result) DirectMetadata(key string) string

func (Result) Metadata

func (result Result) Metadata(key string) string

func (Result) MetadataBool

func (result Result) MetadataBool(key string) bool

type Results

type Results struct {
	Results  []Result
	Includes map[string]Result

	// Only available in query results.
	TotalResults     int64
	SkippedResults   int64
	DurationInMs     int64
	IndexName        string
	IsStale          bool
	CappedMaxResults *int64
}

type RevisionConfig

type RevisionConfig struct {
	MinimumRevisionsToKeep   int64
	MinimumRevisionAgeToKeep Duration
	Disabled, PurgeOnDelete  bool
}

type Revisions

type Revisions struct {
	Default     *RevisionConfig
	Collections map[string]*RevisionConfig
}

Jump to

Keyboard shortcuts

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