cosmos

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	HeaderXDate               = "X-Ms-Date"
	HeaderAuth                = "Authorization"
	HeaderVersion             = "X-Ms-Version"
	HeaderContentType         = "Content-Type"
	HeaderContentLength       = "Content-Length"
	HeaderIsQuery             = "X-Ms-Documentdb-Isquery"
	HeaderUpsert              = "x-ms-documentdb-is-upsert"
	HeaderPartitionKey        = "x-ms-documentdb-partitionkey"
	HeaderMaxItemCount        = "x-ms-max-item-count"
	HeaderContinuation        = "x-ms-continuation"
	HeaderConsistency         = "x-ms-consistency-level"
	HeaderSessionToken        = "x-ms-session-token"
	HeaderCrossPartition      = "x-ms-documentdb-query-enablecrosspartition"
	HeaderIfMatch             = "If-Match"
	HeaderIfNonMatch          = "If-None-Match"
	HeaderIfModifiedSince     = "If-Modified-Since"
	HeaderActivityID          = "x-ms-activity-id"
	HeaderRequestCharge       = "x-ms-request-charge"
	HeaderAIM                 = "A-IM"
	HeaderPartitionKeyRangeID = "x-ms-documentdb-partitionkeyrangeid"
	HeaderRetryAfterMs        = "x-ms-retry-after-ms"
	SupportedVersion          = "2018-12-31"
)

Variables

DefaultSerialization holds default stdlib json driver

View Source
var Serialization = DefaultSerialization

Serialization holds driver that is actually used

Functions

This section is empty.

Types

type CallOption

type CallOption func(r *Request) error

CallOption type defenition.

func ChangeFeed

func ChangeFeed() CallOption

ChangeFeed indicates a change feed request

func ChangeFeedPartitionRangeID

func ChangeFeedPartitionRangeID(id string) CallOption

ChangeFeedPartitionRangeID used in change feed requests. The partition key range ID for reading data.

func ConsistencyLevel

func ConsistencyLevel(consistency Consistency) CallOption

ConsistencyLevel override for read options against documents and attachments. The valid values are: Strong, Bounded, Session, or Eventual (in order of strongest to weakest). The override must be the same or weaker than the account�s configured consistency level.

func Continuation

func Continuation(continuation string) CallOption

Continuation sets continuation token for request

func CrossPartition

func CrossPartition() CallOption

CrossPartition allows query to run on all partitions

func IfMatch

func IfMatch(etag string) CallOption

IfMatch used to make operation conditional for optimistic concurrency. The value should be the etag value of the resource. (applicable only on PUT and DELETE)

func IfModifiedSince

func IfModifiedSince(date string) CallOption

IfModifiedSince returns etag of resource modified after specified date in RFC 1123 format. Ignored when If-None-Match is specified Optional (applicable only on GET)

func IfNoneMatch

func IfNoneMatch(etag string) CallOption

IfNoneMatch makes operation conditional to only execute if the resource has changed. The value should be the etag of the resource. Optional (applicable only on GET)

func Limit

func Limit(limit int) CallOption

Limit set max item count for response

func PartitionKey

func PartitionKey(partitionKey interface{}) CallOption

PartitionKey sets partition for request

func SessionToken

func SessionToken(sessionToken string) CallOption

SessionToken a string token used with session level consistency.

func Upsert

func Upsert() CallOption

Upsert if set to true, Cosmos DB creates the document with the ID (and partition key value if applicable) if it doesn’t exist, or update the document if it exists.

type Client

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

Client model

func New

func New(connString string, opts ...Option) (*Client, error)

New create a new CosmosDB instance

func (Client) Database

func (c Client) Database(dbID string) *Database

Database returns a new Database struct that contains the opertaions you can do on single database

func (*Client) Databases

func (c *Client) Databases() *Databases

Databases returns a new Databases struct used to get data about various databases

func (Client) Offer

func (c Client) Offer(offerID string) *Offer

Offer defines all operation on a single offer

func (Client) Offers

func (c Client) Offers() *Offers

Offers defines all operation possible on multiple offers

type Collection

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

Collection performs operations on a given collection.

func (*Collection) Delete

func (c *Collection) Delete(ctx context.Context) (*Response, error)

Delete collection

func (Collection) Document

func (c Collection) Document(docID string) *Document

Document defines possible operations on a single document. e.g. Read, Delete, Replace

func (Collection) Documents

func (c Collection) Documents() *Documents

Documents defines possible operations on multiple documents. e.g. ReadAll, Query

func (*Collection) Read

Read returns one collection

func (*Collection) Replace

func (c *Collection) Replace(ctx context.Context, i *IndexingPolicy, ret interface{}, opts ...CallOption) (*Response, error)

Replace collection

func (Collection) StoredProcedure

func (c Collection) StoredProcedure(id string) *StoredProcedure

StoredProcedure defines operations on a single stored procedure

func (Collection) StoredProcedures

func (c Collection) StoredProcedures() *StoredProcedures

StoredProcedures defines operations on multiple stored procedures

func (Collection) Trigger

func (c Collection) Trigger(id string) *Trigger

Trigger defines operations on a single trigger

func (Collection) Triggers

func (c Collection) Triggers() *Triggers

Triggers defines operations on multiple triggers

func (Collection) UDF

func (c Collection) UDF(id string) *UDF

UDF defines operations on a user defined function

func (Collection) UDFs

func (c Collection) UDFs() *UDFs

UDFs defines operations on multiple user defined functions

type CollectionDefinition

type CollectionDefinition struct {
	Resource
	IndexingPolicy IndexingPolicy         `json:"indexingPolicy,omitempty"`
	PartitionKey   PartitionKeyDefinition `json:"partitionKey,omitempty"`
	Docs           string                 `json:"_docs,omitempty"`
	Udf            string                 `json:"_udfs,omitempty"`
	Sporcs         string                 `json:"_sporcs,omitempty"`
	Triggers       string                 `json:"_triggers,omitempty"`
	Conflicts      string                 `json:"_conflicts,omitempty"`
}

CollectionDefinition defiens the structure of a Collection

type CollectionDefinitions

type CollectionDefinitions []CollectionDefinition

CollectionDefinitions is a slice of CollectionDefinition elements

func (CollectionDefinitions) At

At return collection at the specified index

func (*CollectionDefinitions) Length

func (c *CollectionDefinitions) Length() int

Length returns the number of collections.

type Collections

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

Collections struct handles all operations involving mutiple collections

func (*Collections) Create

Create new collection

func (*Collections) ReadAll

ReadAll returns all collections in a database.

type Consistency

type Consistency string

Consistency type to define consistency levels

const (
	// Strong consistency level
	Strong Consistency = "strong"

	// Bounded consistency level
	Bounded Consistency = "bounded"

	// Session consistency level
	Session Consistency = "session"

	// Eventual consistency level
	Eventual Consistency = "eventual"
)

type Coordinate

type Coordinate [2]float64

Coordinate = [lon, lat]

type Coordinates

type Coordinates []Coordinate

type CosmosErrorMessage

type CosmosErrorMessage struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type Database

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

Database performs operations on a single database

func (Database) Collection

func (d Database) Collection(collID string) *Collection

Collection gets a handle for a given collection in a database

func (Database) Collections

func (d Database) Collections() *Collections

Collections gets a handle for doing operations on all collections in a database

func (*Database) Delete

func (d *Database) Delete(ctx context.Context) (*Response, error)

Delete database

func (*Database) Read

func (d *Database) Read(ctx context.Context) (*DatabaseDefinition, error)

Read database

func (Database) User

func (d Database) User(id string) *User

User operations

func (Database) Users

func (d Database) Users() *Users

Users operations

type DatabaseDefinition

type DatabaseDefinition struct {
	Resource
	Colls string `json:"_colls,omitempty"`
	Users string `json:"_users,omitempty"`
}

DatabaseDefinition defines the structure of a database data query

type DatabaseDefinitions

type DatabaseDefinitions []DatabaseDefinition

DatabaseDefinitions slice of Database elements

func (*DatabaseDefinitions) Length

func (d *DatabaseDefinitions) Length() int

Length returns the number of databases.

type Databases

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

Databases performs operations on databases

func (*Databases) Create

func (d *Databases) Create(ctx context.Context, dbID string, opts ...CallOption) (*DatabaseDefinition, error)

Create a new database

func (*Databases) Query

func (d *Databases) Query(ctx context.Context, query *SqlQuerySpec, opts ...CallOption) (*DatabaseDefinitions, error)

Query databases

func (*Databases) ReadAll

func (d *Databases) ReadAll(ctx context.Context, opts ...CallOption) (*DatabaseDefinitions, error)

ReadAll databases

type DecoderFactory

type DecoderFactory func(io.Reader) JSONDecoder

DecoderFactory describes function that creates json decoder

type Document

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

Document performs operations on a given document.

func (Document) Delete

func (d Document) Delete(ctx context.Context, opts ...CallOption) (*Response, error)

Delete document

func (Document) Read

func (d Document) Read(ctx context.Context, ret interface{}, opts ...CallOption) (*Response, error)

Read document

func (*Document) Replace

func (d *Document) Replace(ctx context.Context, doc interface{}, ret interface{}, opts ...CallOption) (*Response, error)

Replace existing document

type DocumentDefinition

type DocumentDefinition struct {
	Resource
	Attachments string `json:"attachments,omitempty"`
}

DocumentDefinition defines all the default document properties.

type Documents

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

Documents performs operations on a multiple documents.

func (*Documents) Create

func (d *Documents) Create(ctx context.Context, doc interface{}, opts ...CallOption) (*Response, error)

Create new document

func (Documents) Query

func (d Documents) Query(ctx context.Context, query *SqlQuerySpec, docs interface{}, opts ...CallOption) (*Response, error)

Query documents

func (*Documents) ReadAll

func (d *Documents) ReadAll(ctx context.Context, docs interface{}, opts ...CallOption) (*Response, error)

ReadAll returns all documents in collection.

type EncoderFactory

type EncoderFactory func(*bytes.Buffer) JSONEncoder

EncoderFactory describes function that creates json encoder

type Error

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

Error reports cosmos related errors.

func NewCosmosError

func NewCosmosError(message *CosmosErrorMessage, statusCode int) *Error

NewCosmosError creates a new cosmos error struct

func (*Error) BadRequest

func (e *Error) BadRequest() bool

BadRequest see `https://docs.microsoft.com/en-us/rest/api/cosmos-db/http-status-codes-for-cosmosdb` for possible cause.

func (*Error) Conflict

func (e *Error) Conflict() bool

Conflict returns true if the ID for a resource has already been taken by an existing resource. Only applicable to PUT and POST request. e.g. Create and Replace.

func (*Error) Created

func (e *Error) Created() bool

Created will be true if a resource was created.

func (*Error) EntityTooLarge

func (e *Error) EntityTooLarge() bool

EntityTooLarge returns true if the request exceeded the allowable document size for a request. the max allowable document size is 2 MB.

func (*Error) Error

func (e *Error) Error() string

Error implements the error interface

func (*Error) Forbidden

func (e *Error) Forbidden() bool

Forbidden see `https://docs.microsoft.com/en-us/rest/api/cosmos-db/http-status-codes-for-cosmosdb` for possible cause.

func (*Error) NotFound

func (e *Error) NotFound() bool

NotFound could not find resource.

func (*Error) RequestTimeout

func (e *Error) RequestTimeout() bool

RequestTimeout the operation did not complete within the allotted amount of time.

func (*Error) RetryWith

func (e *Error) RetryWith() bool

RetryWith returns true if the operation encountered a transient error. This code only occurs on write operations. It is safe to retry the operation.

func (*Error) ServiceUnavailable

func (e *Error) ServiceUnavailable() bool

ServiceUnavailable operation could not be completed because the service was unavailable

func (*Error) StatusCode

func (e *Error) StatusCode() int

StatusCode returns status code.

func (*Error) StatusOK

func (e *Error) StatusOK() bool

StatusOK checks is cosmos response was ok.

func (*Error) TooManyRequests

func (e *Error) TooManyRequests() bool

The collection has exceeded the provisioned throughput limit. Retry the request after the server specified retry after duration.

func (*Error) Unauthorized

func (e *Error) Unauthorized() bool

Unauthorized is true of operation was not authorized.

type Geometry

type Geometry interface {
	GeoType() string
}

type IndexingPolicy

type IndexingPolicy struct {
	IndexingMode  string               `json:"indexingMode,omitempty"`
	Automatic     bool                 `json:"automatic,omitempty"`
	IncludedPaths []IndexingPolicyPath `json:"includedPaths,omitempty"`
	ExcludedPaths []IndexingPolicyPath `json:"excludedPaths,omitempty"`
}

IndexingPolicy model

type IndexingPolicyPath

type IndexingPolicyPath struct {
	Path    string        `json:"path,omitempty"`
	Indexes []PolicyIndex `json:"indexes,omitempty"`
}

IndexingPolicyPath model

type Iterator

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

Iterator used to iterate through documents.

func NewIterator

func NewIterator(docs *Documents, query *SqlQuerySpec, data interface{}, opts ...CallOption) *Iterator

NewIterator creates iterator instance

func (*Iterator) Error

func (di *Iterator) Error() error

Errror returns error from last call

func (*Iterator) Next

func (di *Iterator) Next() bool

Next will ask iterator source for results and checks whenever there some more pages left

func (*Iterator) Response

func (di *Iterator) Response() *Response

Response returns *Response object from last call

type IteratorFunc

type IteratorFunc func(docs *Documents, internalOpts ...CallOption) (*Response, error)

IteratorFunc is type that describes iterator source

type JSONDecoder

type JSONDecoder interface {
	Decode(obj interface{}) error
}

JSONDecoder describes json decoder

type JSONEncoder

type JSONEncoder interface {
	Encode(val interface{}) error
}

JSONEncoder describes json encoder

type LineString

type LineString struct {
	Type        string      `json:"type"`
	Coordinates Coordinates `json:"coordinates"`
}

LineString struct defines a line string

func NewLineString

func NewLineString(coords ...Coordinate) *LineString

NewLineString creates a new LineString struct.

func (*LineString) AddPoint

func (l *LineString) AddPoint(lon, lat float64)

AddPoint is a helper method for adding point to a LineString

func (*LineString) Coords

func (l *LineString) Coords() *Coordinates

func (*LineString) GeoType

func (l *LineString) GeoType() string

type Marshal

type Marshal func(v interface{}) ([]byte, error)

Marshal function type

type MsToken

type MsToken struct {
	Token string `json:"token"`
	Range struct {
		Min string `json:"min"`
		Max string `json:"max"`
	} `json:"range"`
}

type Offer

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

func (*Offer) Read

func (o *Offer) Read(ctx context.Context, opts ...CallOption) (*OfferDefinition, error)

func (*Offer) Replace

func (u *Offer) Replace(ctx context.Context, offer *OfferDefinition, opts ...CallOption) (*OfferDefinition, error)

type OfferDefinition

type OfferDefinition struct {
	OfferVersion string `json:"offerVersion"`
	OfferType    string `json:"offerType"`
	Content      struct {
		OfferThroughput int `json:"offerThroughput"`
	} `json:"content"`
	OfferResource   string `json:"resource"`
	OfferResourceID string `json:"offerResourceId"`
	Resource
}

type Offers

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

func (*Offers) Query

func (u *Offers) Query(ctx context.Context, query *SqlQuerySpec, opts ...CallOption) ([]OfferDefinition, error)

func (*Offers) ReadAll

func (o *Offers) ReadAll(ctx context.Context, opts ...CallOption) ([]OfferDefinition, error)

type Option added in v0.1.1

type Option func(*Client)

Option funcitons for configuring the client

func WithClient added in v0.1.1

func WithClient(client *http.Client) Option

WithClient allows you to provide a custom http client

type P

type P = QueryParam

type PartitionKeyDefinition

type PartitionKeyDefinition struct {
	Paths []string `json:"paths"`
	Kind  string   `json:"kind"`
}

PartitionKeyDefinition is used to define a partitionkey.

type PartitionKeyRange

type PartitionKeyRange struct {
	Resource
	PartitionKeyRangeID string `json:"id,omitempty"`
	MinInclusive        string `json:"minInclusive,omitempty"`
	MaxInclusive        string `json:"maxExclusive,omitempty"`
}

PartitionKeyRange partition key range model

type Permission

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

Permission model

func (*Permission) Delete

func (u *Permission) Delete(ctx context.Context, opts ...CallOption) (*Response, error)

Delete permission.

func (*Permission) Read

func (u *Permission) Read(ctx context.Context, opts ...CallOption) (*PermissionDefinition, error)

Read permission.

func (*Permission) Replace

func (u *Permission) Replace(ctx context.Context, permission *PermissionDefinition, opts ...CallOption) (*PermissionDefinition, error)

Replace permission.

type PermissionDefinition

type PermissionDefinition struct {
	ID             string `json:"id"`
	PermissionMode string `json:"permissionMode,omitempty"`
	Resource       string `json:"resource"`
}

PermissionDefinition model

type Permissions

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

Permissions model

func (*Permissions) Create

func (u *Permissions) Create(ctx context.Context, permission *PermissionDefinition, opts ...CallOption) (*PermissionDefinition, error)

Create a new permission

func (*Permissions) ReadAll

func (u *Permissions) ReadAll(ctx context.Context, opts ...CallOption) ([]PermissionDefinition, error)

ReadAll permissions.

type Point

type Point struct {
	Type        string     `json:"type"`
	Coordinates Coordinate `json:"coordinates"`
}

func NewPoint

func NewPoint(coords Coordinate) *Point

NewPoint creates a new point struct and returns it.

func (*Point) Coords

func (p *Point) Coords() *Coordinate

func (*Point) GeoType

func (p *Point) GeoType() string

type PolicyIndex

type PolicyIndex struct {
	DataType  string `json:"dataType,omitempty"`
	Precision int    `json:"precision,omitempty"`
	Kind      string `json:"kind,omitempty"`
}

PolicyIndex

type Polygon

type Polygon struct {
	Type        string        `json:"type"`
	Coordinates []Coordinates `json:"coordinates"`
}

func NewPolygon

func NewPolygon(coords ...Coordinates) *Polygon

NewPolygon creates a new Polygon struct.

func (*Polygon) Coords

func (p *Polygon) Coords() []Coordinates

func (*Polygon) GeoType

func (p *Polygon) GeoType() string

type QueryParam

type QueryParam struct {
	Name  string      `json:"name"`
	Value interface{} `json:"value"`
}

type Request

type Request struct {
	*http.Request
	// contains filtered or unexported fields
}

func ResourceRequest

func ResourceRequest(rLink, rType string, req *http.Request) *Request

Return new resource request with type and id

func (*Request) DefaultHeaders

func (req *Request) DefaultHeaders(mKey string)

Add 3 default headers to request "x-ms-date", "x-ms-version", "authorization"

type Resource

type Resource struct {
	ID   string `json:"id,omitempty"`
	Self string `json:"_self,omitempty"`
	Etag string `json:"_etag,omitempty"`
	Rid  string `json:"_rid,omitempty"`
	Ts   int    `json:"_ts,omitempty"`
}

Resource every cosmos resource have these.

type Response

type Response struct {
	Header http.Header
}

func (*Response) Continuation

func (r *Response) Continuation() string

Continuation returns continuation token for paged request. Pass this value to next request to get next page of documents.

func (*Response) RetryAfterMs

func (r *Response) RetryAfterMs() string

RetryAfterMs returns the number of seconds until you can try to send the response again only applicable to status code 429 To Many Requests

type SerializationDriver

type SerializationDriver struct {
	EncoderFactory EncoderFactory
	DecoderFactory DecoderFactory
	Marshal        Marshal
	Unmarshal      Unmarshal
}

SerializationDriver struct holds serialization / deserilization providers

type SqlQuerySpec

type SqlQuerySpec struct {
	Query      string       `json:"query"`
	Parameters []QueryParam `json:"parameters,omitempty"`
}

func Q

func Q(query string, queryParams ...QueryParam) *SqlQuerySpec

func (SqlQuerySpec) Read

func (q SqlQuerySpec) Read(p []byte) (n int, err error)

type StoredProcedure

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

func (*StoredProcedure) Delete

func (s *StoredProcedure) Delete(ctx context.Context, opts ...CallOption) (*Response, error)

func (*StoredProcedure) Execute

func (s *StoredProcedure) Execute(ctx context.Context, params, body interface{}, opts ...CallOption) (*Response, error)

Execute stored procedure

func (*StoredProcedure) Replace

func (s *StoredProcedure) Replace(ctx context.Context, newStoredProcedure *StoredProcedureDefinition, opts ...CallOption) (*StoredProcedureDefinition, error)

type StoredProcedureDefinition

type StoredProcedureDefinition struct {
	Resource
	Body string `json:"body,omitempty"`
}

StoredProcedureDefinition stored procedure model

type StoredProcedures

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

func (*StoredProcedures) Create

func (s *StoredProcedures) Create(ctx context.Context, newStoredProcedure *StoredProcedureDefinition, opts ...CallOption) (*StoredProcedureDefinition, error)

func (*StoredProcedures) ReadAll

type Trigger

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

func (*Trigger) Delete

func (s *Trigger) Delete(ctx context.Context, opts ...CallOption) (*Response, error)

func (*Trigger) Execute

func (s *Trigger) Execute(ctx context.Context, params, body interface{}, opts ...CallOption) (*Response, error)

Execute stored procedure

func (*Trigger) Replace

func (s *Trigger) Replace(ctx context.Context, trigger *TriggerDefintion, opts ...CallOption) (*TriggerDefintion, error)

type TriggerDefintion

type TriggerDefintion struct {
	Resource
	Body             string `json:"body"`
	TriggerOperation string `json:"triggerOperation"`
	TriggerType      string `json:"triggerType"`
}

TriggerDefinition defines the model of a cosmos trigger.

type Triggers

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

func (*Triggers) Create

func (s *Triggers) Create(ctx context.Context, newTrigger *TriggerDefintion, opts ...CallOption) (*TriggerDefintion, error)

func (*Triggers) ReadAll

func (s *Triggers) ReadAll(ctx context.Context, opts ...CallOption) ([]TriggerDefintion, error)

type UDF

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

func (*UDF) Delete

func (u *UDF) Delete(ctx context.Context, opts ...CallOption) (*Response, error)

func (*UDF) Replace

func (u *UDF) Replace(ctx context.Context, newUDF *UDFDefinition, opts ...CallOption) (*UDFDefinition, error)

type UDFDefinition

type UDFDefinition struct {
	Resource
	Body string `json:"body,omitempty"`
}

UDFDefinition (User Defined Function) definition

type UDFs

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

func (*UDFs) Create

func (u *UDFs) Create(ctx context.Context, newUDF *UDFDefinition, opts ...CallOption) (*UDFDefinition, error)

func (*UDFs) ReadAll

func (u *UDFs) ReadAll(ctx context.Context, opts ...CallOption) ([]UDFDefinition, error)

type Unmarshal

type Unmarshal func(data []byte, v interface{}) error

Unmarshal function type

type User

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

func (*User) Delete

func (u *User) Delete(ctx context.Context, opts ...CallOption) (*Response, error)

Delete existing user

func (User) Permission

func (u User) Permission(id string) *Permission

func (User) Permissions

func (u User) Permissions() *Permissions

func (*User) Read

func (u *User) Read(ctx context.Context, opts ...CallOption) (*UserDefinition, error)

Read a single user from collection

func (*User) Replace

func (u *User) Replace(ctx context.Context, user *UserDefinition, opts ...CallOption) (*UserDefinition, error)

Replace an existing user with a new one.

type UserDefinition

type UserDefinition struct {
	Resource
	// contains filtered or unexported fields
}

type Users

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

func (*Users) Create

func (u *Users) Create(ctx context.Context, user *UserDefinition, opts ...CallOption) (*UserDefinition, error)

Create a new user

func (*Users) ReadAll

func (u *Users) ReadAll(ctx context.Context, opts ...CallOption) ([]UserDefinition, error)

ReadAll users in a collection

Jump to

Keyboard shortcuts

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