Documentation ¶
Index ¶
- Constants
- Variables
- func NewApiResultFail(msg string, code int) []byte
- func NewApiResultPass(data interface{}) []byte
- func NewTypedApiResult[T any](data *T, code int, err *string) []byte
- type ApiResult
- type CatalogEntry
- type CatalogNameValidationResult
- type CatalogShareSummary
- type CatalogSummary
- type ClaimOpts
- type CommunityStats
- type ContextBoundEvent
- type ContextQueryResponse
- type DownloadOptions
- type DownloadRequest
- type DownloadResponse
- type Heartbeat
- type HubOptions
- type InitOptions
- type NatsterContext
- type NatsterEvent
- type NatsterInitializedEvent
- type Options
- type OtcClaimRequest
- type OtcGenerateResponse
- type ShareOptions
- type TypedApiResult
- type WebLoginOpts
- type WhoamiResponse
Constants ¶
View Source
const ( NatsterInitializedEventType = "natster_initialized" ContextBoundEventType = "context_bound" CatalogImportedEventType = "catalog_imported" )
Variables ¶
View Source
var ( ValidEventTypes = []string{ NatsterInitializedEventType, CatalogSharedEventType, CatalogUnsharedEventType, ContextBoundEventType, CatalogImportedEventType, } )
Functions ¶
func NewApiResultFail ¶
func NewApiResultPass ¶
func NewApiResultPass(data interface{}) []byte
Types ¶
type CatalogEntry ¶
type CatalogEntry struct { Path string `json:"path"` Description string `json:"description"` MimeType string `json:"mime_type"` ByteSize int64 `json:"byte_size"` Hash string `json:"hash"` }
It might feel like a good idea to just use the internal medialibrary.MediaEntry here but once we get to refactoring, that internal type will change and we'll want to insulate clients from that
type CatalogShareSummary ¶
type CatalogShareSummary struct {}
type CatalogSummary ¶
type CatalogSummary struct { Name string `json:"name"` Description string `json:"description"` Image string `json:"image,omitempty"` Entries []CatalogEntry `json:"entries"` }
type CommunityStats ¶
type ContextBoundEvent ¶
type ContextBoundEvent struct { OAuthIdentity string `json:"oauth_id"` BoundContext NatsterContext `json:"bound_context"` }
Occurs when someone with an OAuth ID claims a one-time code, resulting in a binding between the context originally submitted with the code and the OAuth ID, which in turn allows that web user to access their natster resources
type ContextQueryResponse ¶
type ContextQueryResponse struct { Context NatsterContext `json:"context"` UserJwt string `json:"user_jwt"` UserSeed string `json:"user_seed"` }
type DownloadOptions ¶
type DownloadRequest ¶
type DownloadResponse ¶
type Heartbeat ¶
type Heartbeat struct { Catalog string `json:"catalog"` AccountKey string `json:"account_key"` Revision int64 `json:"revision"` }
Heartbeats are emitted to the global service periodically by running natster catalog servers
type HubOptions ¶
type InitOptions ¶
type InitOptions struct { // Personal access token created in synadia cloud Token string }
type NatsterContext ¶
type NatsterContext struct { TeamID string `json:"team_id"` SystemID string `json:"system_id"` AccountID string `json:"account_id"` AccountName string `json:"account_name"` AccountPublicKey string `json:"account_public_key"` Token string `json:"access_token"` UserID string `json:"user_id"` CredsPath string `json:"creds"` }
type NatsterEvent ¶
type NatsterEvent struct { Catalog string `json:"catalog"` Target string `json:"target"` EventType string `json:"event_type"` Data interface{} `json:"data,omitempty"` }
Events are emitted by the natster server process
type NatsterInitializedEvent ¶
type Options ¶
type Options struct { // Creds is nats credentials to authenticate with Creds string // Timeout is how long to wait for operations Timeout time.Duration // Context in which action is to be performed ContextName string }
Options configure the CLI
type OtcClaimRequest ¶
type OtcGenerateResponse ¶
type ShareOptions ¶
type ShareOptions struct {}
type TypedApiResult ¶
type WebLoginOpts ¶
type WebLoginOpts struct {
DisplayQR bool
}
type WhoamiResponse ¶
Click to show internal directories.
Click to hide internal directories.