Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidWebhookRequest is returned when the given webhook request is not valid. ErrInvalidWebhookRequest = errors.New("invalid authorization webhook request") // ErrInvalidWebhookResponse is returned when the given webhook response is not valid. ErrInvalidWebhookResponse = errors.New("invalid authorization webhook response") )
Functions ¶
func IsAuthMethod ¶ added in v0.1.6
IsAuthMethod returns whether the given method can be used for authorization.
Types ¶
type AccessAttribute ¶ added in v0.1.5
AccessAttribute represents an access attribute.
type AccessInfo ¶ added in v0.1.5
type AccessInfo struct { Method Method Attributes []AccessAttribute }
AccessInfo represents an access information.
type AuthWebhookRequest ¶ added in v0.1.5
type AuthWebhookRequest struct { Token string `json:"token"` Method Method `json:"method"` Attributes []AccessAttribute `json:"attributes"` }
AuthWebhookRequest represents the request of authentication webhook.
func NewAuthWebhookRequest ¶ added in v0.1.5
func NewAuthWebhookRequest(reader io.Reader) (*AuthWebhookRequest, error)
NewAuthWebhookRequest creates a new instance of AuthWebhookRequest.
type AuthWebhookResponse ¶ added in v0.1.5
AuthWebhookResponse represents the response of authentication webhook.
func NewAuthWebhookResponse ¶ added in v0.1.5
func NewAuthWebhookResponse(reader io.Reader) (*AuthWebhookResponse, error)
NewAuthWebhookResponse creates a new instance of AuthWebhookResponse.
type Client ¶ added in v0.1.2
type Client struct { ID *time.ActorID MetadataInfo MetadataInfo }
Client represents the Client that communicates with the Agent.
type DocEventType ¶ added in v0.1.6
type DocEventType string
DocEventType represents the event that the Agent delivers to the client.
const ( // DocumentsChangedEvent is an event indicating that documents are being // modified by a change. DocumentsChangedEvent DocEventType = "documents-changed" // DocumentsWatchedEvent is an event that occurs when documents are watched // by other clients. DocumentsWatchedEvent DocEventType = "documents-watched" // DocumentsUnwatchedEvent is an event that occurs when documents are // unwatched by other clients. DocumentsUnwatchedEvent DocEventType = "documents-unwatched" // MetadataChangedEvent is an event indicating that metadata is changed. MetadataChangedEvent DocEventType = "metadata-changed" )
type Metadata ¶ added in v0.1.7
Metadata represents custom metadata that can be defined in the client.
type MetadataInfo ¶ added in v0.1.7
MetadataInfo is a metadata information with logical clock.
func (*MetadataInfo) Update ¶ added in v0.1.7
func (i *MetadataInfo) Update(info MetadataInfo) bool
Update updates the given metadata information with the given clock.
type Method ¶ added in v0.1.5
type Method string
Method represents a method name of RPC.
const ( ActivateClient Method = "ActivateClient" DeactivateClient Method = "DeactivateClient" AttachDocument Method = "AttachDocument" DetachDocument Method = "DetachDocument" PushPull Method = "PushPull" WatchDocuments Method = "WatchDocuments" )
Belows are the names of RPCs.
func AuthMethods ¶ added in v0.1.6
func AuthMethods() []Method
AuthMethods returns a slice of methods that can be used for authorization.