user

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const MessagesPathPrefix = "/twirp/elephant.user.Messages/"

MessagesPathPrefix is a convenience constant that may identify URL paths. Should be used with caution, it only matches routes generated by Twirp Go clients, with the default "/twirp" prefix and default CamelCase service and method names. More info: https://twitchtv.github.io/twirp/docs/routing.html

View Source
const SettingsPathPrefix = "/twirp/elephant.user.Settings/"

SettingsPathPrefix is a convenience constant that may identify URL paths. Should be used with caution, it only matches routes generated by Twirp Go clients, with the default "/twirp" prefix and default CamelCase service and method names. More info: https://twitchtv.github.io/twirp/docs/routing.html

Variables

View Source
var (
	EventLogEntryType_name = map[int32]string{
		0: "EVENT_LOG_ENTRY_UNSPECIFIED",
		1: "EVENT_LOG_ENTRY_UPDATE",
		2: "EVENT_LOG_ENTRY_DELETE",
	}
	EventLogEntryType_value = map[string]int32{
		"EVENT_LOG_ENTRY_UNSPECIFIED": 0,
		"EVENT_LOG_ENTRY_UPDATE":      1,
		"EVENT_LOG_ENTRY_DELETE":      2,
	}
)

Enum value maps for EventLogEntryType.

View Source
var (
	ResourceKind_name = map[int32]string{
		0: "RESOURCE_KIND_UNSPECIFIED",
		1: "RESOURCE_KIND_DOCUMENT",
		2: "RESOURCE_KIND_PROPERTY",
	}
	ResourceKind_value = map[string]int32{
		"RESOURCE_KIND_UNSPECIFIED": 0,
		"RESOURCE_KIND_DOCUMENT":    1,
		"RESOURCE_KIND_PROPERTY":    2,
	}
)

Enum value maps for ResourceKind.

View Source
var File_user_service_proto protoreflect.FileDescriptor

Functions

func WriteError

func WriteError(resp http.ResponseWriter, err error)

WriteError writes an HTTP response with a valid Twirp error format (code, msg, meta). Useful outside of the Twirp server (e.g. http middleware), but does not trigger hooks. If err is not a twirp.Error, it will get wrapped with twirp.InternalErrorWith(err)

Types

type DeleteDocumentRequest added in v0.20.0

type DeleteDocumentRequest struct {

	// URI of the document owner. If omitted, defaults to the caller URI (`sub` claim).
	// Can be a user, unit or organization. (e.g., core://user/1234, core://unit/abc, core://org/ab)
	// Only admin users can delete documents owned by a unit or organization.
	Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
	// The unique application identifier in reverse domain notation
	// (e.g., `com.example.assignments` or `com.example.writer`).
	Application string `protobuf:"bytes,2,opt,name=application,proto3" json:"application,omitempty"`
	// Type is the content type of the document.
	Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
	// Unique identifier for the document within the scope of the application and type.
	// Can be a human readable slug or a UUID.
	Key string `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteDocumentRequest) Descriptor deprecated added in v0.20.0

func (*DeleteDocumentRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeleteDocumentRequest.ProtoReflect.Descriptor instead.

func (*DeleteDocumentRequest) GetApplication added in v0.20.0

func (x *DeleteDocumentRequest) GetApplication() string

func (*DeleteDocumentRequest) GetKey added in v0.20.0

func (x *DeleteDocumentRequest) GetKey() string

func (*DeleteDocumentRequest) GetOwner added in v0.20.0

func (x *DeleteDocumentRequest) GetOwner() string

func (*DeleteDocumentRequest) GetType added in v0.20.0

func (x *DeleteDocumentRequest) GetType() string

func (*DeleteDocumentRequest) ProtoMessage added in v0.20.0

func (*DeleteDocumentRequest) ProtoMessage()

func (*DeleteDocumentRequest) ProtoReflect added in v0.20.0

func (x *DeleteDocumentRequest) ProtoReflect() protoreflect.Message

func (*DeleteDocumentRequest) Reset added in v0.20.0

func (x *DeleteDocumentRequest) Reset()

func (*DeleteDocumentRequest) String added in v0.20.0

func (x *DeleteDocumentRequest) String() string

type DeleteDocumentResponse added in v0.20.0

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

func (*DeleteDocumentResponse) Descriptor deprecated added in v0.20.0

func (*DeleteDocumentResponse) Descriptor() ([]byte, []int)

Deprecated: Use DeleteDocumentResponse.ProtoReflect.Descriptor instead.

func (*DeleteDocumentResponse) ProtoMessage added in v0.20.0

func (*DeleteDocumentResponse) ProtoMessage()

func (*DeleteDocumentResponse) ProtoReflect added in v0.20.0

func (x *DeleteDocumentResponse) ProtoReflect() protoreflect.Message

func (*DeleteDocumentResponse) Reset added in v0.20.0

func (x *DeleteDocumentResponse) Reset()

func (*DeleteDocumentResponse) String added in v0.20.0

func (x *DeleteDocumentResponse) String() string

type DeleteInboxMessageRequest

type DeleteInboxMessageRequest struct {

	// ID of the message.
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteInboxMessageRequest) Descriptor deprecated

func (*DeleteInboxMessageRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeleteInboxMessageRequest.ProtoReflect.Descriptor instead.

func (*DeleteInboxMessageRequest) GetId

func (x *DeleteInboxMessageRequest) GetId() int64

func (*DeleteInboxMessageRequest) ProtoMessage

func (*DeleteInboxMessageRequest) ProtoMessage()

func (*DeleteInboxMessageRequest) ProtoReflect

func (*DeleteInboxMessageRequest) Reset

func (x *DeleteInboxMessageRequest) Reset()

func (*DeleteInboxMessageRequest) String

func (x *DeleteInboxMessageRequest) String() string

type DeleteInboxMessageResponse

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

func (*DeleteInboxMessageResponse) Descriptor deprecated

func (*DeleteInboxMessageResponse) Descriptor() ([]byte, []int)

Deprecated: Use DeleteInboxMessageResponse.ProtoReflect.Descriptor instead.

func (*DeleteInboxMessageResponse) ProtoMessage

func (*DeleteInboxMessageResponse) ProtoMessage()

func (*DeleteInboxMessageResponse) ProtoReflect

func (*DeleteInboxMessageResponse) Reset

func (x *DeleteInboxMessageResponse) Reset()

func (*DeleteInboxMessageResponse) String

func (x *DeleteInboxMessageResponse) String() string

type DeletePropertiesRequest added in v0.20.0

type DeletePropertiesRequest struct {
	Properties []*PropertyDelete `protobuf:"bytes,1,rep,name=properties,proto3" json:"properties,omitempty"`
	// contains filtered or unexported fields
}

func (*DeletePropertiesRequest) Descriptor deprecated added in v0.20.0

func (*DeletePropertiesRequest) Descriptor() ([]byte, []int)

Deprecated: Use DeletePropertiesRequest.ProtoReflect.Descriptor instead.

func (*DeletePropertiesRequest) GetProperties added in v0.20.0

func (x *DeletePropertiesRequest) GetProperties() []*PropertyDelete

func (*DeletePropertiesRequest) ProtoMessage added in v0.20.0

func (*DeletePropertiesRequest) ProtoMessage()

func (*DeletePropertiesRequest) ProtoReflect added in v0.20.0

func (x *DeletePropertiesRequest) ProtoReflect() protoreflect.Message

func (*DeletePropertiesRequest) Reset added in v0.20.0

func (x *DeletePropertiesRequest) Reset()

func (*DeletePropertiesRequest) String added in v0.20.0

func (x *DeletePropertiesRequest) String() string

type DeletePropertiesResponse added in v0.20.0

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

func (*DeletePropertiesResponse) Descriptor deprecated added in v0.20.0

func (*DeletePropertiesResponse) Descriptor() ([]byte, []int)

Deprecated: Use DeletePropertiesResponse.ProtoReflect.Descriptor instead.

func (*DeletePropertiesResponse) ProtoMessage added in v0.20.0

func (*DeletePropertiesResponse) ProtoMessage()

func (*DeletePropertiesResponse) ProtoReflect added in v0.20.0

func (x *DeletePropertiesResponse) ProtoReflect() protoreflect.Message

func (*DeletePropertiesResponse) Reset added in v0.20.0

func (x *DeletePropertiesResponse) Reset()

func (*DeletePropertiesResponse) String added in v0.20.0

func (x *DeletePropertiesResponse) String() string

type Document added in v0.20.0

type Document struct {

	// URI of the document owner.
	Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
	// The unique application identifier in reverse domain notation
	// (e.g., `com.example.assignments` or `com.example.writer`).
	Application string `protobuf:"bytes,2,opt,name=application,proto3" json:"application,omitempty"`
	// Type is the content type of the document.
	Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
	// Unique identifier for the document within the scope of the application and type.
	// Can be a human readable slug or a UUID.
	Key string `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"`
	// Version of the document.
	Version int64 `protobuf:"varint,5,opt,name=version,proto3" json:"version,omitempty"`
	// Semver string indicating the schema version of the payload.
	SchemaVersion string `protobuf:"bytes,6,opt,name=schema_version,json=schemaVersion,proto3" json:"schema_version,omitempty"`
	// ReadOnly is set to true if the document is shared.
	ReadOnly bool `protobuf:"varint,7,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"`
	// Title of the document.
	Title string `protobuf:"bytes,8,opt,name=title,proto3" json:"title,omitempty"`
	// Creation time in RFC3339 format.
	Created string `protobuf:"bytes,9,opt,name=created,proto3" json:"created,omitempty"`
	// Last update time in RFC3339 format.
	Updated string `protobuf:"bytes,10,opt,name=updated,proto3" json:"updated,omitempty"`
	// UpdatedBy is the identity of the party that last updated the document.
	UpdatedBy string `protobuf:"bytes,11,opt,name=updated_by,json=updatedBy,proto3" json:"updated_by,omitempty"`
	// Payload contains a newsdoc document with actual configuration data.
	Payload *newsdoc.Document `protobuf:"bytes,12,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

func (*Document) Descriptor deprecated added in v0.20.0

func (*Document) Descriptor() ([]byte, []int)

Deprecated: Use Document.ProtoReflect.Descriptor instead.

func (*Document) GetApplication added in v0.20.0

func (x *Document) GetApplication() string

func (*Document) GetCreated added in v0.20.0

func (x *Document) GetCreated() string

func (*Document) GetKey added in v0.20.0

func (x *Document) GetKey() string

func (*Document) GetOwner added in v0.20.0

func (x *Document) GetOwner() string

func (*Document) GetPayload added in v0.20.0

func (x *Document) GetPayload() *newsdoc.Document

func (*Document) GetReadOnly added in v0.20.0

func (x *Document) GetReadOnly() bool

func (*Document) GetSchemaVersion added in v0.20.0

func (x *Document) GetSchemaVersion() string

func (*Document) GetTitle added in v0.20.0

func (x *Document) GetTitle() string

func (*Document) GetType added in v0.20.0

func (x *Document) GetType() string

func (*Document) GetUpdated added in v0.20.0

func (x *Document) GetUpdated() string

func (*Document) GetUpdatedBy added in v0.20.0

func (x *Document) GetUpdatedBy() string

func (*Document) GetVersion added in v0.20.0

func (x *Document) GetVersion() int64

func (*Document) ProtoMessage added in v0.20.0

func (*Document) ProtoMessage()

func (*Document) ProtoReflect added in v0.20.0

func (x *Document) ProtoReflect() protoreflect.Message

func (*Document) Reset added in v0.20.0

func (x *Document) Reset()

func (*Document) String added in v0.20.0

func (x *Document) String() string

type EventLogEntry added in v0.20.0

type EventLogEntry struct {

	// ID of the event.
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// ID of the resource owner. Can be a user, unit or organization.
	// (e.g., core://user/1234, core://unit/abc, core://org/ab)
	Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"`
	// The type of change.
	Type EventLogEntryType `protobuf:"varint,3,opt,name=type,proto3,enum=elephant.user.EventLogEntryType" json:"type,omitempty"`
	// Kind of the resource.
	Kind ResourceKind `protobuf:"varint,4,opt,name=kind,proto3,enum=elephant.user.ResourceKind" json:"kind,omitempty"`
	// The unique application identifier in reverse domain notation
	// (e.g., `com.example.assignments` or `com.example.writer`).
	Application string `protobuf:"bytes,5,opt,name=application,proto3" json:"application,omitempty"`
	// DocumentType is the content type of the document.
	DocumentType string `protobuf:"bytes,6,opt,name=document_type,json=documentType,proto3" json:"document_type,omitempty"`
	// Unique identifier for a resource within the scope of the owner and
	// application (and document type when kind is `RESOURCE_KIND_DOCUMENT`).
	Key string `protobuf:"bytes,7,opt,name=key,proto3" json:"key,omitempty"`
	// Version of the document.
	Version int64 `protobuf:"varint,8,opt,name=version,proto3" json:"version,omitempty"`
	// UpdatedBy is the identity of the party that last updated the resource.
	UpdatedBy string `protobuf:"bytes,9,opt,name=updated_by,json=updatedBy,proto3" json:"updated_by,omitempty"`
	// Occurrence time in RFC3339 format.
	Created string `protobuf:"bytes,10,opt,name=created,proto3" json:"created,omitempty"`
	// contains filtered or unexported fields
}

func (*EventLogEntry) Descriptor deprecated added in v0.20.0

func (*EventLogEntry) Descriptor() ([]byte, []int)

Deprecated: Use EventLogEntry.ProtoReflect.Descriptor instead.

func (*EventLogEntry) GetApplication added in v0.20.0

func (x *EventLogEntry) GetApplication() string

func (*EventLogEntry) GetCreated added in v0.20.0

func (x *EventLogEntry) GetCreated() string

func (*EventLogEntry) GetDocumentType added in v0.20.0

func (x *EventLogEntry) GetDocumentType() string

func (*EventLogEntry) GetId added in v0.20.0

func (x *EventLogEntry) GetId() int64

func (*EventLogEntry) GetKey added in v0.20.0

func (x *EventLogEntry) GetKey() string

func (*EventLogEntry) GetKind added in v0.20.0

func (x *EventLogEntry) GetKind() ResourceKind

func (*EventLogEntry) GetOwner added in v0.20.0

func (x *EventLogEntry) GetOwner() string

func (*EventLogEntry) GetType added in v0.20.0

func (x *EventLogEntry) GetType() EventLogEntryType

func (*EventLogEntry) GetUpdatedBy added in v0.20.0

func (x *EventLogEntry) GetUpdatedBy() string

func (*EventLogEntry) GetVersion added in v0.20.0

func (x *EventLogEntry) GetVersion() int64

func (*EventLogEntry) ProtoMessage added in v0.20.0

func (*EventLogEntry) ProtoMessage()

func (*EventLogEntry) ProtoReflect added in v0.20.0

func (x *EventLogEntry) ProtoReflect() protoreflect.Message

func (*EventLogEntry) Reset added in v0.20.0

func (x *EventLogEntry) Reset()

func (*EventLogEntry) String added in v0.20.0

func (x *EventLogEntry) String() string

type EventLogEntryType added in v0.20.0

type EventLogEntryType int32
const (
	EventLogEntryType_EVENT_LOG_ENTRY_UNSPECIFIED EventLogEntryType = 0
	EventLogEntryType_EVENT_LOG_ENTRY_UPDATE      EventLogEntryType = 1
	EventLogEntryType_EVENT_LOG_ENTRY_DELETE      EventLogEntryType = 2
)

func (EventLogEntryType) Descriptor added in v0.20.0

func (EventLogEntryType) Enum added in v0.20.0

func (EventLogEntryType) EnumDescriptor deprecated added in v0.20.0

func (EventLogEntryType) EnumDescriptor() ([]byte, []int)

Deprecated: Use EventLogEntryType.Descriptor instead.

func (EventLogEntryType) Number added in v0.20.0

func (EventLogEntryType) String added in v0.20.0

func (x EventLogEntryType) String() string

func (EventLogEntryType) Type added in v0.20.0

type GetDocumentRequest added in v0.20.0

type GetDocumentRequest struct {

	// URI of the document owner. Optional, defaults to the caller URI (`sub` claim).
	// Can be a user, unit or organization. (e.g., core://user/1234, core://unit/abc, core://org/ab)
	Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
	// The unique application identifier in reverse domain notation
	// (e.g., `com.example.assignments` or `com.example.writer`).
	Application string `protobuf:"bytes,2,opt,name=application,proto3" json:"application,omitempty"`
	// Type is the content type of the document.
	Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
	// Unique identifier for the document within the scope of the application and type.
	// Can be a human readable slug or a UUID.
	Key string `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

func (*GetDocumentRequest) Descriptor deprecated added in v0.20.0

func (*GetDocumentRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetDocumentRequest.ProtoReflect.Descriptor instead.

func (*GetDocumentRequest) GetApplication added in v0.20.0

func (x *GetDocumentRequest) GetApplication() string

func (*GetDocumentRequest) GetKey added in v0.20.0

func (x *GetDocumentRequest) GetKey() string

func (*GetDocumentRequest) GetOwner added in v0.20.0

func (x *GetDocumentRequest) GetOwner() string

func (*GetDocumentRequest) GetType added in v0.20.0

func (x *GetDocumentRequest) GetType() string

func (*GetDocumentRequest) ProtoMessage added in v0.20.0

func (*GetDocumentRequest) ProtoMessage()

func (*GetDocumentRequest) ProtoReflect added in v0.20.0

func (x *GetDocumentRequest) ProtoReflect() protoreflect.Message

func (*GetDocumentRequest) Reset added in v0.20.0

func (x *GetDocumentRequest) Reset()

func (*GetDocumentRequest) String added in v0.20.0

func (x *GetDocumentRequest) String() string

type GetDocumentResponse added in v0.20.0

type GetDocumentResponse struct {
	Document *Document `protobuf:"bytes,1,opt,name=document,proto3" json:"document,omitempty"`
	// contains filtered or unexported fields
}

func (*GetDocumentResponse) Descriptor deprecated added in v0.20.0

func (*GetDocumentResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetDocumentResponse.ProtoReflect.Descriptor instead.

func (*GetDocumentResponse) GetDocument added in v0.20.0

func (x *GetDocumentResponse) GetDocument() *Document

func (*GetDocumentResponse) ProtoMessage added in v0.20.0

func (*GetDocumentResponse) ProtoMessage()

func (*GetDocumentResponse) ProtoReflect added in v0.20.0

func (x *GetDocumentResponse) ProtoReflect() protoreflect.Message

func (*GetDocumentResponse) Reset added in v0.20.0

func (x *GetDocumentResponse) Reset()

func (*GetDocumentResponse) String added in v0.20.0

func (x *GetDocumentResponse) String() string

type GetPropertiesRequest added in v0.20.0

type GetPropertiesRequest struct {

	// The unique application identifier in reverse domain notation
	// (e.g., `com.example.assignments` or `com.example.writer`).
	// If empty, returns properties across all applications.
	Application string `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty"`
	// Unique identifier(s) for the property.
	// If provided, filters properties by key.
	// If `application` is empty, returns properties with these keys across all applications.
	Keys []string `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPropertiesRequest) Descriptor deprecated added in v0.20.0

func (*GetPropertiesRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetPropertiesRequest.ProtoReflect.Descriptor instead.

func (*GetPropertiesRequest) GetApplication added in v0.20.0

func (x *GetPropertiesRequest) GetApplication() string

func (*GetPropertiesRequest) GetKeys added in v0.20.0

func (x *GetPropertiesRequest) GetKeys() []string

func (*GetPropertiesRequest) ProtoMessage added in v0.20.0

func (*GetPropertiesRequest) ProtoMessage()

func (*GetPropertiesRequest) ProtoReflect added in v0.20.0

func (x *GetPropertiesRequest) ProtoReflect() protoreflect.Message

func (*GetPropertiesRequest) Reset added in v0.20.0

func (x *GetPropertiesRequest) Reset()

func (*GetPropertiesRequest) String added in v0.20.0

func (x *GetPropertiesRequest) String() string

type GetPropertiesResponse added in v0.20.0

type GetPropertiesResponse struct {
	Properties []*Property `protobuf:"bytes,1,rep,name=properties,proto3" json:"properties,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPropertiesResponse) Descriptor deprecated added in v0.20.0

func (*GetPropertiesResponse) Descriptor() ([]byte, []int)

Deprecated: Use GetPropertiesResponse.ProtoReflect.Descriptor instead.

func (*GetPropertiesResponse) GetProperties added in v0.20.0

func (x *GetPropertiesResponse) GetProperties() []*Property

func (*GetPropertiesResponse) ProtoMessage added in v0.20.0

func (*GetPropertiesResponse) ProtoMessage()

func (*GetPropertiesResponse) ProtoReflect added in v0.20.0

func (x *GetPropertiesResponse) ProtoReflect() protoreflect.Message

func (*GetPropertiesResponse) Reset added in v0.20.0

func (x *GetPropertiesResponse) Reset()

func (*GetPropertiesResponse) String added in v0.20.0

func (x *GetPropertiesResponse) String() string

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient is the interface used by generated clients to send HTTP requests. It is fulfilled by *(net/http).Client, which is sufficient for most users. Users can provide their own implementation for special retry policies.

HTTPClient implementations should not follow redirects. Redirects are automatically disabled if *(net/http).Client is passed to client constructors. See the withoutRedirects function in this file for more details.

type InboxMessage

type InboxMessage struct {

	// Recipient of the message (user sub).
	Recipient string `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"`
	// ID of the message.
	Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
	// Created timestamp is the RFC3339 timestamp
	// for when the message was created.
	Created string `protobuf:"bytes,3,opt,name=created,proto3" json:"created,omitempty"`
	// Creator of the message (application sub).
	CreatedBy string `protobuf:"bytes,4,opt,name=created_by,json=createdBy,proto3" json:"created_by,omitempty"`
	// Updated timestamp is the RFC3339 timestamp
	// for when the message was last updated.
	Updated string `protobuf:"bytes,5,opt,name=updated,proto3" json:"updated,omitempty"`
	// Indicates whether the message has been read.
	IsRead bool `protobuf:"varint,6,opt,name=is_read,json=isRead,proto3" json:"is_read,omitempty"`
	// Payload containing a newsdoc document.
	Payload *newsdoc.Document `protobuf:"bytes,7,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

func (*InboxMessage) Descriptor deprecated

func (*InboxMessage) Descriptor() ([]byte, []int)

Deprecated: Use InboxMessage.ProtoReflect.Descriptor instead.

func (*InboxMessage) GetCreated

func (x *InboxMessage) GetCreated() string

func (*InboxMessage) GetCreatedBy

func (x *InboxMessage) GetCreatedBy() string

func (*InboxMessage) GetId

func (x *InboxMessage) GetId() int64

func (*InboxMessage) GetIsRead

func (x *InboxMessage) GetIsRead() bool

func (*InboxMessage) GetPayload

func (x *InboxMessage) GetPayload() *newsdoc.Document

func (*InboxMessage) GetRecipient

func (x *InboxMessage) GetRecipient() string

func (*InboxMessage) GetUpdated

func (x *InboxMessage) GetUpdated() string

func (*InboxMessage) ProtoMessage

func (*InboxMessage) ProtoMessage()

func (*InboxMessage) ProtoReflect

func (x *InboxMessage) ProtoReflect() protoreflect.Message

func (*InboxMessage) Reset

func (x *InboxMessage) Reset()

func (*InboxMessage) String

func (x *InboxMessage) String() string

type ListDocumentsRequest added in v0.20.0

type ListDocumentsRequest struct {

	// The unique application identifier in reverse domain notation
	// (e.g., `com.example.assignments` or `com.example.writer`).
	// If empty, returns documents across all applications.
	Application string `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty"`
	// Type is the content type of the document.
	// If provided, filters documents by type.
	// If `application` is empty, returns documents of this type across all applications.
	Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	// If true, include the document payload in the response.
	// If false (default), payload will be omitted.
	IncludePayload bool `protobuf:"varint,3,opt,name=include_payload,json=includePayload,proto3" json:"include_payload,omitempty"`
	// contains filtered or unexported fields
}

func (*ListDocumentsRequest) Descriptor deprecated added in v0.20.0

func (*ListDocumentsRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListDocumentsRequest.ProtoReflect.Descriptor instead.

func (*ListDocumentsRequest) GetApplication added in v0.20.0

func (x *ListDocumentsRequest) GetApplication() string

func (*ListDocumentsRequest) GetIncludePayload added in v0.20.0

func (x *ListDocumentsRequest) GetIncludePayload() bool

func (*ListDocumentsRequest) GetType added in v0.20.0

func (x *ListDocumentsRequest) GetType() string

func (*ListDocumentsRequest) ProtoMessage added in v0.20.0

func (*ListDocumentsRequest) ProtoMessage()

func (*ListDocumentsRequest) ProtoReflect added in v0.20.0

func (x *ListDocumentsRequest) ProtoReflect() protoreflect.Message

func (*ListDocumentsRequest) Reset added in v0.20.0

func (x *ListDocumentsRequest) Reset()

func (*ListDocumentsRequest) String added in v0.20.0

func (x *ListDocumentsRequest) String() string

type ListDocumentsResponse added in v0.20.0

type ListDocumentsResponse struct {
	Documents []*Document `protobuf:"bytes,1,rep,name=documents,proto3" json:"documents,omitempty"`
	// contains filtered or unexported fields
}

func (*ListDocumentsResponse) Descriptor deprecated added in v0.20.0

func (*ListDocumentsResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListDocumentsResponse.ProtoReflect.Descriptor instead.

func (*ListDocumentsResponse) GetDocuments added in v0.20.0

func (x *ListDocumentsResponse) GetDocuments() []*Document

func (*ListDocumentsResponse) ProtoMessage added in v0.20.0

func (*ListDocumentsResponse) ProtoMessage()

func (*ListDocumentsResponse) ProtoReflect added in v0.20.0

func (x *ListDocumentsResponse) ProtoReflect() protoreflect.Message

func (*ListDocumentsResponse) Reset added in v0.20.0

func (x *ListDocumentsResponse) Reset()

func (*ListDocumentsResponse) String added in v0.20.0

func (x *ListDocumentsResponse) String() string

type ListInboxMessagesRequest

type ListInboxMessagesRequest struct {

	// ID of the message before which to list messages.
	BeforeId int64 `protobuf:"varint,1,opt,name=before_id,json=beforeId,proto3" json:"before_id,omitempty"`
	// Number of messages to include in the results (defaults to 10).
	Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"`
	// contains filtered or unexported fields
}

func (*ListInboxMessagesRequest) Descriptor deprecated

func (*ListInboxMessagesRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListInboxMessagesRequest.ProtoReflect.Descriptor instead.

func (*ListInboxMessagesRequest) GetBeforeId

func (x *ListInboxMessagesRequest) GetBeforeId() int64

func (*ListInboxMessagesRequest) GetSize

func (x *ListInboxMessagesRequest) GetSize() int64

func (*ListInboxMessagesRequest) ProtoMessage

func (*ListInboxMessagesRequest) ProtoMessage()

func (*ListInboxMessagesRequest) ProtoReflect

func (x *ListInboxMessagesRequest) ProtoReflect() protoreflect.Message

func (*ListInboxMessagesRequest) Reset

func (x *ListInboxMessagesRequest) Reset()

func (*ListInboxMessagesRequest) String

func (x *ListInboxMessagesRequest) String() string

type ListInboxMessagesResponse

type ListInboxMessagesResponse struct {

	// ID of the latest message returned. Useful for subsequent polling requests.
	LatestId int64 `protobuf:"varint,1,opt,name=latest_id,json=latestId,proto3" json:"latest_id,omitempty"`
	// ID of the earliest message returned. Use for paginating backward.
	EarliestId int64 `protobuf:"varint,2,opt,name=earliest_id,json=earliestId,proto3" json:"earliest_id,omitempty"`
	// Messages sorted in descending order by id (newest first).
	Messages []*InboxMessage `protobuf:"bytes,3,rep,name=messages,proto3" json:"messages,omitempty"`
	// contains filtered or unexported fields
}

func (*ListInboxMessagesResponse) Descriptor deprecated

func (*ListInboxMessagesResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListInboxMessagesResponse.ProtoReflect.Descriptor instead.

func (*ListInboxMessagesResponse) GetEarliestId added in v0.17.11

func (x *ListInboxMessagesResponse) GetEarliestId() int64

func (*ListInboxMessagesResponse) GetLatestId added in v0.17.11

func (x *ListInboxMessagesResponse) GetLatestId() int64

func (*ListInboxMessagesResponse) GetMessages

func (x *ListInboxMessagesResponse) GetMessages() []*InboxMessage

func (*ListInboxMessagesResponse) ProtoMessage

func (*ListInboxMessagesResponse) ProtoMessage()

func (*ListInboxMessagesResponse) ProtoReflect

func (*ListInboxMessagesResponse) Reset

func (x *ListInboxMessagesResponse) Reset()

func (*ListInboxMessagesResponse) String

func (x *ListInboxMessagesResponse) String() string

type Message

type Message struct {

	// ID of the message.
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// Type of message being sent (e.g. "rpc_error").
	Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
	// Created timestamp is the RFC3339 timestamp
	// for when the message was created.
	Created string `protobuf:"bytes,3,opt,name=created,proto3" json:"created,omitempty"`
	// Creator of the message (application sub).
	CreatedBy string `protobuf:"bytes,4,opt,name=created_by,json=createdBy,proto3" json:"created_by,omitempty"`
	// Recipient of the message (user sub).
	Recipient string `protobuf:"bytes,5,opt,name=recipient,proto3" json:"recipient,omitempty"`
	// UUID of the associated document, optional.
	DocUuid string `protobuf:"bytes,6,opt,name=doc_uuid,json=docUuid,proto3" json:"doc_uuid,omitempty"`
	// Type of the associated document, optional.
	DocType string `protobuf:"bytes,7,opt,name=doc_type,json=docType,proto3" json:"doc_type,omitempty"`
	// Payload containing a key-value map.
	Payload map[string]string `` /* 141-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Message) Descriptor deprecated

func (*Message) Descriptor() ([]byte, []int)

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetCreated

func (x *Message) GetCreated() string

func (*Message) GetCreatedBy

func (x *Message) GetCreatedBy() string

func (*Message) GetDocType

func (x *Message) GetDocType() string

func (*Message) GetDocUuid

func (x *Message) GetDocUuid() string

func (*Message) GetId

func (x *Message) GetId() int64

func (*Message) GetPayload

func (x *Message) GetPayload() map[string]string

func (*Message) GetRecipient

func (x *Message) GetRecipient() string

func (*Message) GetType

func (x *Message) GetType() string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

func (x *Message) ProtoReflect() protoreflect.Message

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type Messages

type Messages interface {
	// Pushes a new message to a recipient.
	PushMessage(context.Context, *PushMessageRequest) (*PushMessageResponse, error)

	// Pushes a new inbox message to a recipient.
	PushInboxMessage(context.Context, *PushInboxMessageRequest) (*PushInboxMessageResponse, error)

	// Polls for new messages for a recipient.
	PollMessages(context.Context, *PollMessagesRequest) (*PollMessagesResponse, error)

	// Polls for new inbox messages for a recipient.
	PollInboxMessages(context.Context, *PollInboxMessagesRequest) (*PollInboxMessagesResponse, error)

	// Lists all inbox messages for a recipient.
	ListInboxMessages(context.Context, *ListInboxMessagesRequest) (*ListInboxMessagesResponse, error)

	// Updates an existing inbox message.
	UpdateInboxMessage(context.Context, *UpdateInboxMessageRequest) (*UpdateInboxMessageResponse, error)

	// Deletes an inbox message.
	DeleteInboxMessage(context.Context, *DeleteInboxMessageRequest) (*DeleteInboxMessageResponse, error)
}

func NewMessagesJSONClient

func NewMessagesJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Messages

NewMessagesJSONClient creates a JSON client that implements the Messages interface. It communicates using JSON and can be configured with a custom HTTPClient.

func NewMessagesProtobufClient

func NewMessagesProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Messages

NewMessagesProtobufClient creates a Protobuf client that implements the Messages interface. It communicates using Protobuf and can be configured with a custom HTTPClient.

type PollEventLogRequest added in v0.20.0

type PollEventLogRequest struct {

	// ID of the event after which to start returning events.
	// Set to -1 for the initial request.
	AfterId int64 `protobuf:"varint,1,opt,name=after_id,json=afterId,proto3" json:"after_id,omitempty"`
	// contains filtered or unexported fields
}

func (*PollEventLogRequest) Descriptor deprecated added in v0.20.0

func (*PollEventLogRequest) Descriptor() ([]byte, []int)

Deprecated: Use PollEventLogRequest.ProtoReflect.Descriptor instead.

func (*PollEventLogRequest) GetAfterId added in v0.20.0

func (x *PollEventLogRequest) GetAfterId() int64

func (*PollEventLogRequest) ProtoMessage added in v0.20.0

func (*PollEventLogRequest) ProtoMessage()

func (*PollEventLogRequest) ProtoReflect added in v0.20.0

func (x *PollEventLogRequest) ProtoReflect() protoreflect.Message

func (*PollEventLogRequest) Reset added in v0.20.0

func (x *PollEventLogRequest) Reset()

func (*PollEventLogRequest) String added in v0.20.0

func (x *PollEventLogRequest) String() string

type PollEventLogResponse added in v0.20.0

type PollEventLogResponse struct {

	// ID of the most recent event returned. Use for subsequent polling requests.
	// If no new events are returned, it matches the `after_id` from the request.
	LastId int64 `protobuf:"varint,1,opt,name=last_id,json=lastId,proto3" json:"last_id,omitempty"`
	// Event log items sorted in ascending order by id (oldest first).
	Entries []*EventLogEntry `protobuf:"bytes,2,rep,name=entries,proto3" json:"entries,omitempty"`
	// contains filtered or unexported fields
}

func (*PollEventLogResponse) Descriptor deprecated added in v0.20.0

func (*PollEventLogResponse) Descriptor() ([]byte, []int)

Deprecated: Use PollEventLogResponse.ProtoReflect.Descriptor instead.

func (*PollEventLogResponse) GetEntries added in v0.20.0

func (x *PollEventLogResponse) GetEntries() []*EventLogEntry

func (*PollEventLogResponse) GetLastId added in v0.20.0

func (x *PollEventLogResponse) GetLastId() int64

func (*PollEventLogResponse) ProtoMessage added in v0.20.0

func (*PollEventLogResponse) ProtoMessage()

func (*PollEventLogResponse) ProtoReflect added in v0.20.0

func (x *PollEventLogResponse) ProtoReflect() protoreflect.Message

func (*PollEventLogResponse) Reset added in v0.20.0

func (x *PollEventLogResponse) Reset()

func (*PollEventLogResponse) String added in v0.20.0

func (x *PollEventLogResponse) String() string

type PollInboxMessagesRequest

type PollInboxMessagesRequest struct {

	// ID of the message after which to start returning messages.
	// Set to -1 for the initial request.
	AfterId int64 `protobuf:"varint,1,opt,name=after_id,json=afterId,proto3" json:"after_id,omitempty"`
	// contains filtered or unexported fields
}

func (*PollInboxMessagesRequest) Descriptor deprecated

func (*PollInboxMessagesRequest) Descriptor() ([]byte, []int)

Deprecated: Use PollInboxMessagesRequest.ProtoReflect.Descriptor instead.

func (*PollInboxMessagesRequest) GetAfterId

func (x *PollInboxMessagesRequest) GetAfterId() int64

func (*PollInboxMessagesRequest) ProtoMessage

func (*PollInboxMessagesRequest) ProtoMessage()

func (*PollInboxMessagesRequest) ProtoReflect

func (x *PollInboxMessagesRequest) ProtoReflect() protoreflect.Message

func (*PollInboxMessagesRequest) Reset

func (x *PollInboxMessagesRequest) Reset()

func (*PollInboxMessagesRequest) String

func (x *PollInboxMessagesRequest) String() string

type PollInboxMessagesResponse

type PollInboxMessagesResponse struct {

	// ID of the most recent message returned. Use for subsequent polling requests.
	// If no new messages are returned, it matches the `after_id` from the request.
	LastId int64 `protobuf:"varint,1,opt,name=last_id,json=lastId,proto3" json:"last_id,omitempty"`
	// Messages sorted in ascending order by id (oldest first).
	Messages []*InboxMessage `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"`
	// contains filtered or unexported fields
}

func (*PollInboxMessagesResponse) Descriptor deprecated

func (*PollInboxMessagesResponse) Descriptor() ([]byte, []int)

Deprecated: Use PollInboxMessagesResponse.ProtoReflect.Descriptor instead.

func (*PollInboxMessagesResponse) GetLastId added in v0.17.11

func (x *PollInboxMessagesResponse) GetLastId() int64

func (*PollInboxMessagesResponse) GetMessages

func (x *PollInboxMessagesResponse) GetMessages() []*InboxMessage

func (*PollInboxMessagesResponse) ProtoMessage

func (*PollInboxMessagesResponse) ProtoMessage()

func (*PollInboxMessagesResponse) ProtoReflect

func (*PollInboxMessagesResponse) Reset

func (x *PollInboxMessagesResponse) Reset()

func (*PollInboxMessagesResponse) String

func (x *PollInboxMessagesResponse) String() string

type PollMessagesRequest

type PollMessagesRequest struct {

	// ID of the message after which to start returning messages.
	// Set to -1 for the initial request.
	AfterId int64 `protobuf:"varint,1,opt,name=after_id,json=afterId,proto3" json:"after_id,omitempty"`
	// contains filtered or unexported fields
}

func (*PollMessagesRequest) Descriptor deprecated

func (*PollMessagesRequest) Descriptor() ([]byte, []int)

Deprecated: Use PollMessagesRequest.ProtoReflect.Descriptor instead.

func (*PollMessagesRequest) GetAfterId

func (x *PollMessagesRequest) GetAfterId() int64

func (*PollMessagesRequest) ProtoMessage

func (*PollMessagesRequest) ProtoMessage()

func (*PollMessagesRequest) ProtoReflect

func (x *PollMessagesRequest) ProtoReflect() protoreflect.Message

func (*PollMessagesRequest) Reset

func (x *PollMessagesRequest) Reset()

func (*PollMessagesRequest) String

func (x *PollMessagesRequest) String() string

type PollMessagesResponse

type PollMessagesResponse struct {

	// ID of the most recent message returned. Use for subsequent polling requests.
	// If no new messages are returned, it matches the `after_id` from the request.
	LastId int64 `protobuf:"varint,1,opt,name=last_id,json=lastId,proto3" json:"last_id,omitempty"`
	// Messages sorted in ascending order by id (oldest first).
	Messages []*Message `protobuf:"bytes,2,rep,name=messages,proto3" json:"messages,omitempty"`
	// contains filtered or unexported fields
}

func (*PollMessagesResponse) Descriptor deprecated

func (*PollMessagesResponse) Descriptor() ([]byte, []int)

Deprecated: Use PollMessagesResponse.ProtoReflect.Descriptor instead.

func (*PollMessagesResponse) GetLastId added in v0.17.11

func (x *PollMessagesResponse) GetLastId() int64

func (*PollMessagesResponse) GetMessages

func (x *PollMessagesResponse) GetMessages() []*Message

func (*PollMessagesResponse) ProtoMessage

func (*PollMessagesResponse) ProtoMessage()

func (*PollMessagesResponse) ProtoReflect

func (x *PollMessagesResponse) ProtoReflect() protoreflect.Message

func (*PollMessagesResponse) Reset

func (x *PollMessagesResponse) Reset()

func (*PollMessagesResponse) String

func (x *PollMessagesResponse) String() string

type Property added in v0.20.0

type Property struct {

	// URI of the property owner. Matches the caller `sub` claim.
	Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
	// The unique application identifier in reverse domain notation
	// (e.g., `com.example.assignments` or `com.example.writer`).
	Application string `protobuf:"bytes,2,opt,name=application,proto3" json:"application,omitempty"`
	// Unique identifier for the property within the application.
	Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
	// The value serialized as a string.
	Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"`
	// Creation time in RFC3339 format.
	Created string `protobuf:"bytes,5,opt,name=created,proto3" json:"created,omitempty"`
	// Last update time in RFC3339 format.
	Updated string `protobuf:"bytes,6,opt,name=updated,proto3" json:"updated,omitempty"`
	// contains filtered or unexported fields
}

Property represents a generic key-value pair attached to a user. It can be used for preferences, user state, feature flags etc.

func (*Property) Descriptor deprecated added in v0.20.0

func (*Property) Descriptor() ([]byte, []int)

Deprecated: Use Property.ProtoReflect.Descriptor instead.

func (*Property) GetApplication added in v0.20.0

func (x *Property) GetApplication() string

func (*Property) GetCreated added in v0.20.0

func (x *Property) GetCreated() string

func (*Property) GetKey added in v0.20.0

func (x *Property) GetKey() string

func (*Property) GetOwner added in v0.20.0

func (x *Property) GetOwner() string

func (*Property) GetUpdated added in v0.20.0

func (x *Property) GetUpdated() string

func (*Property) GetValue added in v0.20.0

func (x *Property) GetValue() string

func (*Property) ProtoMessage added in v0.20.0

func (*Property) ProtoMessage()

func (*Property) ProtoReflect added in v0.20.0

func (x *Property) ProtoReflect() protoreflect.Message

func (*Property) Reset added in v0.20.0

func (x *Property) Reset()

func (*Property) String added in v0.20.0

func (x *Property) String() string

type PropertyDelete added in v0.20.0

type PropertyDelete struct {

	// The unique application identifier in reverse domain notation
	// (e.g., `com.example.assignments` or `com.example.writer`).
	Application string `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty"`
	// Unique identifier for the property within the application.
	Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

func (*PropertyDelete) Descriptor deprecated added in v0.20.0

func (*PropertyDelete) Descriptor() ([]byte, []int)

Deprecated: Use PropertyDelete.ProtoReflect.Descriptor instead.

func (*PropertyDelete) GetApplication added in v0.20.0

func (x *PropertyDelete) GetApplication() string

func (*PropertyDelete) GetKey added in v0.20.0

func (x *PropertyDelete) GetKey() string

func (*PropertyDelete) ProtoMessage added in v0.20.0

func (*PropertyDelete) ProtoMessage()

func (*PropertyDelete) ProtoReflect added in v0.20.0

func (x *PropertyDelete) ProtoReflect() protoreflect.Message

func (*PropertyDelete) Reset added in v0.20.0

func (x *PropertyDelete) Reset()

func (*PropertyDelete) String added in v0.20.0

func (x *PropertyDelete) String() string

type PropertyUpdate added in v0.20.0

type PropertyUpdate struct {

	// The unique application identifier in reverse domain notation
	// (e.g., `com.example.assignments` or `com.example.writer`).
	Application string `protobuf:"bytes,1,opt,name=application,proto3" json:"application,omitempty"`
	// Unique identifier for the property within the application.
	Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	// The value serialized as a string.
	Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*PropertyUpdate) Descriptor deprecated added in v0.20.0

func (*PropertyUpdate) Descriptor() ([]byte, []int)

Deprecated: Use PropertyUpdate.ProtoReflect.Descriptor instead.

func (*PropertyUpdate) GetApplication added in v0.20.0

func (x *PropertyUpdate) GetApplication() string

func (*PropertyUpdate) GetKey added in v0.20.0

func (x *PropertyUpdate) GetKey() string

func (*PropertyUpdate) GetValue added in v0.20.0

func (x *PropertyUpdate) GetValue() string

func (*PropertyUpdate) ProtoMessage added in v0.20.0

func (*PropertyUpdate) ProtoMessage()

func (*PropertyUpdate) ProtoReflect added in v0.20.0

func (x *PropertyUpdate) ProtoReflect() protoreflect.Message

func (*PropertyUpdate) Reset added in v0.20.0

func (x *PropertyUpdate) Reset()

func (*PropertyUpdate) String added in v0.20.0

func (x *PropertyUpdate) String() string

type PushInboxMessageRequest

type PushInboxMessageRequest struct {

	// Recipient of the message (user sub).
	Recipient string `protobuf:"bytes,1,opt,name=recipient,proto3" json:"recipient,omitempty"`
	// Payload containing a newsdoc document.
	Payload *newsdoc.Document `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

func (*PushInboxMessageRequest) Descriptor deprecated

func (*PushInboxMessageRequest) Descriptor() ([]byte, []int)

Deprecated: Use PushInboxMessageRequest.ProtoReflect.Descriptor instead.

func (*PushInboxMessageRequest) GetPayload

func (x *PushInboxMessageRequest) GetPayload() *newsdoc.Document

func (*PushInboxMessageRequest) GetRecipient

func (x *PushInboxMessageRequest) GetRecipient() string

func (*PushInboxMessageRequest) ProtoMessage

func (*PushInboxMessageRequest) ProtoMessage()

func (*PushInboxMessageRequest) ProtoReflect

func (x *PushInboxMessageRequest) ProtoReflect() protoreflect.Message

func (*PushInboxMessageRequest) Reset

func (x *PushInboxMessageRequest) Reset()

func (*PushInboxMessageRequest) String

func (x *PushInboxMessageRequest) String() string

type PushInboxMessageResponse

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

func (*PushInboxMessageResponse) Descriptor deprecated

func (*PushInboxMessageResponse) Descriptor() ([]byte, []int)

Deprecated: Use PushInboxMessageResponse.ProtoReflect.Descriptor instead.

func (*PushInboxMessageResponse) ProtoMessage

func (*PushInboxMessageResponse) ProtoMessage()

func (*PushInboxMessageResponse) ProtoReflect

func (x *PushInboxMessageResponse) ProtoReflect() protoreflect.Message

func (*PushInboxMessageResponse) Reset

func (x *PushInboxMessageResponse) Reset()

func (*PushInboxMessageResponse) String

func (x *PushInboxMessageResponse) String() string

type PushMessageRequest

type PushMessageRequest struct {

	// Type of message being sent (e.g. "rpc_error").
	Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	// Recipient of the message (user sub).
	Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"`
	// UUID of the associated document, optional.
	DocUuid string `protobuf:"bytes,3,opt,name=doc_uuid,json=docUuid,proto3" json:"doc_uuid,omitempty"`
	// Type of the associated document, optional.
	DocType string `protobuf:"bytes,4,opt,name=doc_type,json=docType,proto3" json:"doc_type,omitempty"`
	// Payload containing a key-value map.
	Payload map[string]string `` /* 141-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*PushMessageRequest) Descriptor deprecated

func (*PushMessageRequest) Descriptor() ([]byte, []int)

Deprecated: Use PushMessageRequest.ProtoReflect.Descriptor instead.

func (*PushMessageRequest) GetDocType

func (x *PushMessageRequest) GetDocType() string

func (*PushMessageRequest) GetDocUuid

func (x *PushMessageRequest) GetDocUuid() string

func (*PushMessageRequest) GetPayload

func (x *PushMessageRequest) GetPayload() map[string]string

func (*PushMessageRequest) GetRecipient

func (x *PushMessageRequest) GetRecipient() string

func (*PushMessageRequest) GetType

func (x *PushMessageRequest) GetType() string

func (*PushMessageRequest) ProtoMessage

func (*PushMessageRequest) ProtoMessage()

func (*PushMessageRequest) ProtoReflect

func (x *PushMessageRequest) ProtoReflect() protoreflect.Message

func (*PushMessageRequest) Reset

func (x *PushMessageRequest) Reset()

func (*PushMessageRequest) String

func (x *PushMessageRequest) String() string

type PushMessageResponse

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

func (*PushMessageResponse) Descriptor deprecated

func (*PushMessageResponse) Descriptor() ([]byte, []int)

Deprecated: Use PushMessageResponse.ProtoReflect.Descriptor instead.

func (*PushMessageResponse) ProtoMessage

func (*PushMessageResponse) ProtoMessage()

func (*PushMessageResponse) ProtoReflect

func (x *PushMessageResponse) ProtoReflect() protoreflect.Message

func (*PushMessageResponse) Reset

func (x *PushMessageResponse) Reset()

func (*PushMessageResponse) String

func (x *PushMessageResponse) String() string

type ResourceKind added in v0.20.0

type ResourceKind int32
const (
	ResourceKind_RESOURCE_KIND_UNSPECIFIED ResourceKind = 0
	ResourceKind_RESOURCE_KIND_DOCUMENT    ResourceKind = 1
	ResourceKind_RESOURCE_KIND_PROPERTY    ResourceKind = 2
)

func (ResourceKind) Descriptor added in v0.20.0

func (ResourceKind) Enum added in v0.20.0

func (x ResourceKind) Enum() *ResourceKind

func (ResourceKind) EnumDescriptor deprecated added in v0.20.0

func (ResourceKind) EnumDescriptor() ([]byte, []int)

Deprecated: Use ResourceKind.Descriptor instead.

func (ResourceKind) Number added in v0.20.0

func (ResourceKind) String added in v0.20.0

func (x ResourceKind) String() string

func (ResourceKind) Type added in v0.20.0

type SetPropertiesRequest added in v0.20.0

type SetPropertiesRequest struct {
	Properties []*PropertyUpdate `protobuf:"bytes,1,rep,name=properties,proto3" json:"properties,omitempty"`
	// contains filtered or unexported fields
}

func (*SetPropertiesRequest) Descriptor deprecated added in v0.20.0

func (*SetPropertiesRequest) Descriptor() ([]byte, []int)

Deprecated: Use SetPropertiesRequest.ProtoReflect.Descriptor instead.

func (*SetPropertiesRequest) GetProperties added in v0.20.0

func (x *SetPropertiesRequest) GetProperties() []*PropertyUpdate

func (*SetPropertiesRequest) ProtoMessage added in v0.20.0

func (*SetPropertiesRequest) ProtoMessage()

func (*SetPropertiesRequest) ProtoReflect added in v0.20.0

func (x *SetPropertiesRequest) ProtoReflect() protoreflect.Message

func (*SetPropertiesRequest) Reset added in v0.20.0

func (x *SetPropertiesRequest) Reset()

func (*SetPropertiesRequest) String added in v0.20.0

func (x *SetPropertiesRequest) String() string

type SetPropertiesResponse added in v0.20.0

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

func (*SetPropertiesResponse) Descriptor deprecated added in v0.20.0

func (*SetPropertiesResponse) Descriptor() ([]byte, []int)

Deprecated: Use SetPropertiesResponse.ProtoReflect.Descriptor instead.

func (*SetPropertiesResponse) ProtoMessage added in v0.20.0

func (*SetPropertiesResponse) ProtoMessage()

func (*SetPropertiesResponse) ProtoReflect added in v0.20.0

func (x *SetPropertiesResponse) ProtoReflect() protoreflect.Message

func (*SetPropertiesResponse) Reset added in v0.20.0

func (x *SetPropertiesResponse) Reset()

func (*SetPropertiesResponse) String added in v0.20.0

func (x *SetPropertiesResponse) String() string

type Settings added in v0.20.0

type Settings interface {
	// Gets a specific document for the authenticated user.
	GetDocument(context.Context, *GetDocumentRequest) (*GetDocumentResponse, error)

	// Lists documents for the authenticated user.
	ListDocuments(context.Context, *ListDocumentsRequest) (*ListDocumentsResponse, error)

	// Updates an existing or creates a new document for the authenticated user.
	UpdateDocument(context.Context, *UpdateDocumentRequest) (*UpdateDocumentResponse, error)

	// Deletes a document for the authenticated user.
	DeleteDocument(context.Context, *DeleteDocumentRequest) (*DeleteDocumentResponse, error)

	// Gets properties for the authenticated user.
	GetProperties(context.Context, *GetPropertiesRequest) (*GetPropertiesResponse, error)

	// Sets or updates properties for the authenticated user.
	SetProperties(context.Context, *SetPropertiesRequest) (*SetPropertiesResponse, error)

	// Deletes properties for the authenticated user.
	DeleteProperties(context.Context, *DeletePropertiesRequest) (*DeletePropertiesResponse, error)

	// Polls for a stream of changes (creates, updates, deletes)
	// for both documents and properties for the authenticated user.
	PollEventLog(context.Context, *PollEventLogRequest) (*PollEventLogResponse, error)
}

Settings service manages configuration for authenticated users.

All methods in this service rely on the `sub` claim from the authentication (bearer) token to identify the target user.

func NewSettingsJSONClient added in v0.20.0

func NewSettingsJSONClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Settings

NewSettingsJSONClient creates a JSON client that implements the Settings interface. It communicates using JSON and can be configured with a custom HTTPClient.

func NewSettingsProtobufClient added in v0.20.0

func NewSettingsProtobufClient(baseURL string, client HTTPClient, opts ...twirp.ClientOption) Settings

NewSettingsProtobufClient creates a Protobuf client that implements the Settings interface. It communicates using Protobuf and can be configured with a custom HTTPClient.

type TwirpServer

type TwirpServer interface {
	http.Handler

	// ServiceDescriptor returns gzipped bytes describing the .proto file that
	// this service was generated from. Once unzipped, the bytes can be
	// unmarshalled as a
	// google.golang.org/protobuf/types/descriptorpb.FileDescriptorProto.
	//
	// The returned integer is the index of this particular service within that
	// FileDescriptorProto's 'Service' slice of ServiceDescriptorProtos. This is a
	// low-level field, expected to be used for reflection.
	ServiceDescriptor() ([]byte, int)

	// ProtocGenTwirpVersion is the semantic version string of the version of
	// twirp used to generate this file.
	ProtocGenTwirpVersion() string

	// PathPrefix returns the HTTP URL path prefix for all methods handled by this
	// service. This can be used with an HTTP mux to route Twirp requests.
	// The path prefix is in the form: "/<prefix>/<package>.<Service>/"
	// that is, everything in a Twirp route except for the <Method> at the end.
	PathPrefix() string
}

TwirpServer is the interface generated server structs will support: they're HTTP handlers with additional methods for accessing metadata about the service. Those accessors are a low-level API for building reflection tools. Most people can think of TwirpServers as just http.Handlers.

func NewMessagesServer

func NewMessagesServer(svc Messages, opts ...interface{}) TwirpServer

NewMessagesServer builds a TwirpServer that can be used as an http.Handler to handle HTTP requests that are routed to the right method in the provided svc implementation. The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks).

func NewSettingsServer added in v0.20.0

func NewSettingsServer(svc Settings, opts ...interface{}) TwirpServer

NewSettingsServer builds a TwirpServer that can be used as an http.Handler to handle HTTP requests that are routed to the right method in the provided svc implementation. The opts are twirp.ServerOption modifiers, for example twirp.WithServerHooks(hooks).

type UpdateDocumentRequest added in v0.20.0

type UpdateDocumentRequest struct {

	// URI of the document owner. Optional, defaults to the caller URI (`sub` claim).
	// Can be a user, unit or organization. (e.g., core://user/1234, core://unit/abc, core://org/ab)
	// Only admin users can set it to a unit or organization.
	Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"`
	// The unique application identifier in reverse domain notation
	// (e.g., `com.example.assignments` or `com.example.writer`).
	Application string `protobuf:"bytes,2,opt,name=application,proto3" json:"application,omitempty"`
	// Type is the content type of the document.
	Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
	// Unique identifier for the document within the scope of the application and type.
	// Can be a human readable slug or a UUID.
	Key string `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"`
	// Semver string indicating the schema version of the payload.
	SchemaVersion string `protobuf:"bytes,5,opt,name=schema_version,json=schemaVersion,proto3" json:"schema_version,omitempty"`
	// Payload contains a newsdoc document with actual configuration data.
	Payload *newsdoc.Document `protobuf:"bytes,6,opt,name=payload,proto3" json:"payload,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateDocumentRequest) Descriptor deprecated added in v0.20.0

func (*UpdateDocumentRequest) Descriptor() ([]byte, []int)

Deprecated: Use UpdateDocumentRequest.ProtoReflect.Descriptor instead.

func (*UpdateDocumentRequest) GetApplication added in v0.20.0

func (x *UpdateDocumentRequest) GetApplication() string

func (*UpdateDocumentRequest) GetKey added in v0.20.0

func (x *UpdateDocumentRequest) GetKey() string

func (*UpdateDocumentRequest) GetOwner added in v0.20.0

func (x *UpdateDocumentRequest) GetOwner() string

func (*UpdateDocumentRequest) GetPayload added in v0.20.0

func (x *UpdateDocumentRequest) GetPayload() *newsdoc.Document

func (*UpdateDocumentRequest) GetSchemaVersion added in v0.20.0

func (x *UpdateDocumentRequest) GetSchemaVersion() string

func (*UpdateDocumentRequest) GetType added in v0.20.0

func (x *UpdateDocumentRequest) GetType() string

func (*UpdateDocumentRequest) ProtoMessage added in v0.20.0

func (*UpdateDocumentRequest) ProtoMessage()

func (*UpdateDocumentRequest) ProtoReflect added in v0.20.0

func (x *UpdateDocumentRequest) ProtoReflect() protoreflect.Message

func (*UpdateDocumentRequest) Reset added in v0.20.0

func (x *UpdateDocumentRequest) Reset()

func (*UpdateDocumentRequest) String added in v0.20.0

func (x *UpdateDocumentRequest) String() string

type UpdateDocumentResponse added in v0.20.0

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

func (*UpdateDocumentResponse) Descriptor deprecated added in v0.20.0

func (*UpdateDocumentResponse) Descriptor() ([]byte, []int)

Deprecated: Use UpdateDocumentResponse.ProtoReflect.Descriptor instead.

func (*UpdateDocumentResponse) ProtoMessage added in v0.20.0

func (*UpdateDocumentResponse) ProtoMessage()

func (*UpdateDocumentResponse) ProtoReflect added in v0.20.0

func (x *UpdateDocumentResponse) ProtoReflect() protoreflect.Message

func (*UpdateDocumentResponse) Reset added in v0.20.0

func (x *UpdateDocumentResponse) Reset()

func (*UpdateDocumentResponse) String added in v0.20.0

func (x *UpdateDocumentResponse) String() string

type UpdateInboxMessageRequest

type UpdateInboxMessageRequest struct {

	// ID of the message.
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// Sets the message's read status.
	IsRead bool `protobuf:"varint,2,opt,name=is_read,json=isRead,proto3" json:"is_read,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateInboxMessageRequest) Descriptor deprecated

func (*UpdateInboxMessageRequest) Descriptor() ([]byte, []int)

Deprecated: Use UpdateInboxMessageRequest.ProtoReflect.Descriptor instead.

func (*UpdateInboxMessageRequest) GetId

func (x *UpdateInboxMessageRequest) GetId() int64

func (*UpdateInboxMessageRequest) GetIsRead

func (x *UpdateInboxMessageRequest) GetIsRead() bool

func (*UpdateInboxMessageRequest) ProtoMessage

func (*UpdateInboxMessageRequest) ProtoMessage()

func (*UpdateInboxMessageRequest) ProtoReflect

func (*UpdateInboxMessageRequest) Reset

func (x *UpdateInboxMessageRequest) Reset()

func (*UpdateInboxMessageRequest) String

func (x *UpdateInboxMessageRequest) String() string

type UpdateInboxMessageResponse

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

func (*UpdateInboxMessageResponse) Descriptor deprecated

func (*UpdateInboxMessageResponse) Descriptor() ([]byte, []int)

Deprecated: Use UpdateInboxMessageResponse.ProtoReflect.Descriptor instead.

func (*UpdateInboxMessageResponse) ProtoMessage

func (*UpdateInboxMessageResponse) ProtoMessage()

func (*UpdateInboxMessageResponse) ProtoReflect

func (*UpdateInboxMessageResponse) Reset

func (x *UpdateInboxMessageResponse) Reset()

func (*UpdateInboxMessageResponse) String

func (x *UpdateInboxMessageResponse) String() string

Jump to

Keyboard shortcuts

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