types

package
v1.27.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContentTypeFromAppMode

func ContentTypeFromAppMode(a AppMode) contenttypes.ContentType

Types

type AppMode

type AppMode string
const (
	UnknownMode         AppMode = ""
	ShinyMode           AppMode = "shiny"
	ShinyRmdMode        AppMode = "rmd-shiny"
	StaticRmdMode       AppMode = "rmd-static"
	StaticMode          AppMode = "static"
	PlumberAPIMode      AppMode = "api"
	StaticJupyterMode   AppMode = "jupyter-static"
	PythonAPIMode       AppMode = "python-api"
	PythonDashMode      AppMode = "python-dash"
	PythonStreamlitMode AppMode = "python-streamlit"
	PythonBokehMode     AppMode = "python-bokeh"
	PythonFastAPIMode   AppMode = "python-fastapi"
	PythonGradioMode    AppMode = "python-gradio"
	PythonPanelMode     AppMode = "python-panel"
	ShinyQuartoMode     AppMode = "quarto-shiny"
	StaticQuartoMode    AppMode = "quarto-static"
	PythonShinyMode     AppMode = "python-shiny"
	JupyterVoilaMode    AppMode = "jupyter-voila"
)

These values are the strings that will appear in manifest.json.

func AppModeFromString

func AppModeFromString(s string) (AppMode, error)

AppModeFromString return the normalized string value corresponding to the provided string. UnknownMode and an error are returned if the string does not map to a known content type.

func AppModeFromType

func AppModeFromType(t contenttypes.ContentType) AppMode

func (AppMode) Description

func (t AppMode) Description() string

func (AppMode) IsAPIApp

func (mode AppMode) IsAPIApp() bool

IsAPIApp returns true for any API apps (currently, Plumber, Flask, or FastAPI).

func (AppMode) IsBokehApp

func (t AppMode) IsBokehApp() bool

IsBokehApp returns true for Python Bokeh applications

func (AppMode) IsDashApp

func (t AppMode) IsDashApp() bool

IsDashApp returns true for Python Dash applications

func (AppMode) IsFastAPIApp

func (t AppMode) IsFastAPIApp() bool

IsFastAPIApp returns true for Python FastAPI applications

func (AppMode) IsGradioApp

func (t AppMode) IsGradioApp() bool

IsGradioApp returns true for Python Gradio applications

func (AppMode) IsPanelApp added in v1.26.0

func (t AppMode) IsPanelApp() bool

IsPanelApp returns true for Python Panel applications

func (AppMode) IsPlumberAPI

func (mode AppMode) IsPlumberAPI() bool

IsPlumberAPI returns true for Plumber API applications.

func (AppMode) IsPyShinyApp

func (mode AppMode) IsPyShinyApp() bool

IsPyShinyApp returns true for Python Shiny applications

func (AppMode) IsPythonAPI

func (mode AppMode) IsPythonAPI() bool

IsPythonAPI returns true for Python API applications.

func (AppMode) IsPythonApp

func (mode AppMode) IsPythonApp() bool

IsPythonApp returns true for Python applications (Dash, Streamlit, Bokeh, Voila)

func (AppMode) IsPythonContent

func (t AppMode) IsPythonContent() bool

IsPythonContent returns true if Python is the primary interpreter for this content type.

func (AppMode) IsQuartoContent

func (t AppMode) IsQuartoContent() bool

IsQuartoContent return true if Quarto is the primary driver of this content type.

func (AppMode) IsRContent

func (t AppMode) IsRContent() bool

IsRContent returns true if R is the primary interpreter for this content type.

func (AppMode) IsShinyApp

func (t AppMode) IsShinyApp() bool

IsShinyApp returns true for Shiny applications and interactive R Markdown documents.

func (AppMode) IsStaticContent

func (t AppMode) IsStaticContent() bool

IsStaticContent returns true for any static content (deployed without source).

func (AppMode) IsStaticJupyter

func (t AppMode) IsStaticJupyter() bool

IsStaticJupyter returns true for any non-interactive Jupyter content.

func (AppMode) IsStaticReport

func (t AppMode) IsStaticReport() bool

IsStaticReport returns true for any non-interactive R or Jupyter content.

func (AppMode) IsStaticRmd

func (mode AppMode) IsStaticRmd() bool

IsStaticRmd returns true for any non-interactive R Markdown content.

func (AppMode) IsStreamlitApp

func (t AppMode) IsStreamlitApp() bool

IsStreamlitApp returns true for Python Streamlit applications

func (AppMode) IsVoilaApp

func (mode AppMode) IsVoilaApp() bool

IsVoilaApp returns true for Python Voila interactive notebooks

func (AppMode) IsWorkerApp

func (mode AppMode) IsWorkerApp() bool

IsWorkerApp returns true for any content that is serviced by worker processes. This includes Shiny applications, interactive R Markdown documents, Plumber/Python (flask/fastapi) APIs, and Python apps (Dash, Streamlit, Bokeh, PyShiny, Voila, Gradio, Panel).

func (*AppMode) UnmarshalText

func (mode *AppMode) UnmarshalText(text []byte) error

type AuthorizationRequest

type AuthorizationRequest struct {
	ResourceType string `json:"resource_type"`
	ResourceID   string `json:"resource_id"`
	Permission   string `json:"permission"`
}

AuthorizationRequest represents a request to authorize access to a resource.

type AuthorizationResponse

type AuthorizationResponse struct {
	Authorized bool   `json:"authorized"`
	Token      string `json:"token,omitempty"`
}

AuthorizationResponse represents a response from an authorization request.

type ConnectOptions added in v1.22.0

type ConnectOptions struct {
	ClientReconnectTimeout    *int32   `json:"client_reconnect_timeout,omitempty"`
	ConnTimeout               *int32   `json:"conn_timeout,omitempty"`
	DisconnectDelay           *int32   `json:"disconnect_delay,omitempty"`
	HeartbeatDelay            *int32   `json:"heartbeat_delay,omitempty"`
	IdleTimeout               *int32   `json:"idle_timeout,omitempty"`
	InitTimeout               *int32   `json:"init_timeout,omitempty"`
	ReadTimeout               *int32   `json:"read_timeout,omitempty"`
	SchedLoadFactor           *float64 `json:"sched_load_factor,omitempty"`
	SchedMaxConns             *int32   `json:"sched_max_conns,omitempty"`
	SchedMaxProc              *int32   `json:"sched_max_proc,omitempty"`
	SchedMinProc              *int32   `json:"sched_min_proc,omitempty"`
	ShinyIsolation            *bool    `json:"shiny_isolation,omitempty"`
	ShinyStaleWorkerRedirects *bool    `json:"shiny_stale_worker_redirects,omitempty"`
}

type ContentAccess

type ContentAccess string

ContentAccess represents the access control settings for a content item.

const (
	// ViewPrivateEditPrivate means the content is only visible and editable by the owner.
	ViewPrivateEditPrivate ContentAccess = "view_private_edit_private"
	// ViewTeamEditPrivate means the content is visible to team members but only editable by the owner.
	ViewTeamEditPrivate ContentAccess = "view_team_edit_private"
	// ViewTeamEditTeam means the content is visible and editable by team members.
	ViewTeamEditTeam ContentAccess = "view_team_edit_team"
	// ViewPublicEditPrivate means the content is publicly visible but only editable by the owner.
	ViewPublicEditPrivate ContentAccess = "view_public_edit_private"
	// ViewPublicEditTeam means the content is publicly visible and editable by team members.
	ViewPublicEditTeam ContentAccess = "view_public_edit_team"
)

type ContentRequestBase

type ContentRequestBase struct {
	Title             string           `json:"title"`
	Description       string           `json:"description,omitempty"`
	NextRevision      *RequestRevision `json:"next_revision,omitempty"`
	RevisionOverrides *RequestRevision `json:"revision_overrides,omitempty"`
	Access            ContentAccess    `json:"access,omitempty"`
	Secrets           []Secret         `json:"secrets,omitempty"`
	VanityName        string           `json:"vanity_name,omitempty"`
	AppMode           AppMode          `json:"app_mode"`
	ContentType       ContentType      `json:"content_type"`
}

ContentRequestBase contains common fields for content creation and update requests.

type ContentResponse

type ContentResponse struct {
	ID           types.ContentID `json:"id"`
	NextRevision *Revision       `json:"next_revision,omitempty"`
	Access       ContentAccess   `json:"access"`
}

ContentResponse represents a response from creating or updating a content item.

type ContentType

type ContentType string

ContentType represents the type of content being created.

const (
	// ContentTypeBokeh represents a Bokeh application.
	ContentTypeBokeh ContentType = "bokeh"
	// ContentTypeDash represents a Dash application.
	ContentTypeDash ContentType = "dash"
	// ContentTypeJupyter represents a Jupyter notebook.
	ContentTypeJupyter ContentType = "jupyter"
	// ContentTypeQuarto represents a Quarto document.
	ContentTypeQuarto ContentType = "quarto"
	// ContentTypeShiny represents a Shiny application.
	ContentTypeShiny ContentType = "shiny"
	// ContentTypeStreamlit represents a Streamlit application.
	ContentTypeStreamlit ContentType = "streamlit"
	// ContentTypeRMarkdown represents an R Markdown document.
	ContentTypeRMarkdown ContentType = "rmarkdown"
	// ContentTypeStatic represents static content.
	ContentTypeStatic ContentType = "static"
)

func CloudContentTypeFromPublisherType

func CloudContentTypeFromPublisherType(contentType contenttypes.ContentType) (ContentType, error)

CloudContentTypeFromPublisherType converts publisher content types to cloud client content types

type CreateContentRequest

type CreateContentRequest struct {
	ContentRequestBase
	AccountID string `json:"account_id"`
}

CreateContentRequest represents a request to create a new content item.

type PublishResult

type PublishResult string
const (
	PublishResultSuccess PublishResult = "success"
	PublishResultFailure PublishResult = "failure"
)

type RequestRevision

type RequestRevision struct {
	SourceType     string          `json:"source_type"`
	RVersion       string          `json:"r_version,omitempty"`
	PythonVersion  string          `json:"python_version,omitempty"`
	ContentType    ContentType     `json:"content_type,omitempty"`
	AppMode        AppMode         `json:"app_mode,omitempty"`
	PrimaryFile    string          `json:"primary_file,omitempty"`
	ConnectOptions *ConnectOptions `json:"connect_options,omitempty"`
}

RequestRevision represents the configuration for the next content revision.

type Revision

type Revision struct {
	ID                    string                 `json:"id"`
	PublishLogChannel     string                 `json:"publish_log_channel"`
	PublishResult         PublishResult          `json:"publish_result"`
	PublishErrorCode      string                 `json:"publish_error_code,omitempty"`
	PublishErrorArgs      map[string]interface{} `json:"publish_error_args,omitempty"`
	SourceBundleID        string                 `json:"source_bundle_id"`
	SourceBundleUploadURL string                 `json:"source_bundle_upload_url"`
	PublishError          string                 `json:"publish_error,omitempty"`
	PublishErrorDetails   string                 `json:"publish_error_details,omitempty"`
}

Revision represents a content revision.

type Secret

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

Secret represents a secret key-value pair.

type UpdateContentRequest

type UpdateContentRequest struct {
	ContentRequestBase
	ContentID types.ContentID `json:"-"` // Not sent in the request body, used for the URL
}

UpdateContentRequest represents a request to update an existing content item.

type UserAccountRole

type UserAccountRole struct {
	Role    string                 `json:"role"`
	Account UserAccountRoleAccount `json:"account"`
}

UserAccountRole represents a user's role in an account.

type UserAccountRoleAccount

type UserAccountRoleAccount struct {
	Name string `json:"name"`
}

UserAccountRoleAccount represents an account in a user account role.

type UserResponse

type UserResponse struct {
	AccountRoles map[string]UserAccountRole `json:"account_roles"`
}

UserResponse represents a response from the Connect Cloud user endpoint.

Jump to

Keyboard shortcuts

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