Documentation ¶
Index ¶
- Constants
- Variables
- type AuthToken
- type DeploymentAnnotations
- type Github
- type IssueMagicAuthTokenOptions
- type Options
- type Service
- func (s *Service) CheckBlockingBillingErrors(ctx context.Context, orgID string) error
- func (s *Service) CleanupSubscriptionBillingIssues(ctx context.Context, orgID string) error
- func (s *Service) CleanupTrialBillingIssues(ctx context.Context, orgID string) error
- func (s *Service) Close() error
- func (s *Service) CreateOrUpdateUser(ctx context.Context, email, name, photoURL string) (*database.User, error)
- func (s *Service) CreateOrganizationForUser(ctx context.Context, userID, email, orgName, description string) (*database.Organization, error)
- func (s *Service) CreateProject(ctx context.Context, org *database.Organization, ...) (*database.Project, error)
- func (s *Service) GetGithubInstallation(ctx context.Context, githubURL string) (int64, error)
- func (s *Service) HibernateDeployments(ctx context.Context) error
- func (s *Service) HibernateProject(ctx context.Context, proj *database.Project) (*database.Project, error)
- func (s *Service) InitOrganizationBilling(ctx context.Context, org *database.Organization) (*database.Organization, error)
- func (s *Service) IssueDeploymentAuthToken(ctx context.Context, deploymentID string, ttl *time.Duration) (AuthToken, error)
- func (s *Service) IssueDeviceAuthCode(ctx context.Context, clientID string) (*database.DeviceAuthCode, error)
- func (s *Service) IssueMagicAuthToken(ctx context.Context, opts *IssueMagicAuthTokenOptions) (AuthToken, error)
- func (s *Service) IssueRuntimeManagementToken(aud string) (string, error)
- func (s *Service) IssueServiceAuthToken(ctx context.Context, serviceID string, ttl *time.Duration) (AuthToken, error)
- func (s *Service) IssueUserAuthToken(ctx context.Context, userID, clientID, displayName string, ...) (AuthToken, error)
- func (s *Service) LookupAlert(ctx context.Context, depl *database.Deployment, alertName string) (*runtimev1.AlertSpec, error)
- func (s *Service) LookupGithubRepoForUser(ctx context.Context, installationID int64, githubURL, gitUsername string) (*github.Repository, error)
- func (s *Service) LookupReport(ctx context.Context, depl *database.Deployment, reportName string) (*runtimev1.ReportSpec, error)
- func (s *Service) NewDeploymentAnnotations(org *database.Organization, proj *database.Project) DeploymentAnnotations
- func (s *Service) OpenMetricsProject(ctx context.Context) (*metrics.Client, bool, error)
- func (s *Service) OpenRuntimeClient(depl *database.Deployment) (*client.Client, error)
- func (s *Service) OrganizationPermissionsForDeployment(ctx context.Context, orgID, deploymentID string) (*adminv1.OrganizationPermissions, error)
- func (s *Service) OrganizationPermissionsForMagicAuthToken(ctx context.Context, orgID, tokenProjectID string) (*adminv1.OrganizationPermissions, error)
- func (s *Service) OrganizationPermissionsForService(ctx context.Context, orgID, serviceID string) (*adminv1.OrganizationPermissions, error)
- func (s *Service) OrganizationPermissionsForUser(ctx context.Context, orgID, userID string) (*adminv1.OrganizationPermissions, error)
- func (s *Service) ProcessGithubEvent(ctx context.Context, rawEvent any) error
- func (s *Service) ProjectPermissionsForDeployment(ctx context.Context, projectID, deploymentID string, ...) (*adminv1.ProjectPermissions, error)
- func (s *Service) ProjectPermissionsForMagicAuthToken(ctx context.Context, projectID string, tkn *database.MagicAuthToken) (*adminv1.ProjectPermissions, error)
- func (s *Service) ProjectPermissionsForService(ctx context.Context, projectID, serviceID string, ...) (*adminv1.ProjectPermissions, error)
- func (s *Service) ProjectPermissionsForUser(ctx context.Context, projectID, userID string, ...) (*adminv1.ProjectPermissions, error)
- func (s *Service) RaiseNewOrgBillingIssues(ctx context.Context, orgID string, creationTime time.Time, ...) error
- func (s *Service) RedeployProject(ctx context.Context, proj *database.Project, prevDepl *database.Deployment) (*database.Project, error)
- func (s *Service) RepairOrganizationBilling(ctx context.Context, org *database.Organization, initSub bool) (*database.Organization, *billing.Subscription, error)
- func (s *Service) ResolveLatestRuntimeVersion() string
- func (s *Service) RevokeAuthToken(ctx context.Context, token string) error
- func (s *Service) StartTrial(ctx context.Context, org *database.Organization) (*database.Organization, *billing.Subscription, error)
- func (s *Service) TeardownDeployment(ctx context.Context, depl *database.Deployment) error
- func (s *Service) TeardownProject(ctx context.Context, p *database.Project) error
- func (s *Service) TriggerParser(ctx context.Context, depl *database.Deployment) (err error)
- func (s *Service) TriggerParserAndAwaitResource(ctx context.Context, depl *database.Deployment, name, kind string) error
- func (s *Service) TriggerReport(ctx context.Context, depl *database.Deployment, report string) (err error)
- func (s *Service) UpdateDeployment(ctx context.Context, depl *database.Deployment, opts *UpdateDeploymentOptions) error
- func (s *Service) UpdateOrgDeploymentAnnotations(ctx context.Context, org *database.Organization) error
- func (s *Service) UpdateProject(ctx context.Context, proj *database.Project, ...) (*database.Project, error)
- func (s *Service) ValidateAuthToken(ctx context.Context, token string) (AuthToken, error)
- func (s *Service) ValidateRuntimeVersion(ver string) error
- type URLs
- func (u *URLs) AlertEdit(org, project, alert string) string
- func (u *URLs) AlertOpen(org, project, alert string) string
- func (u *URLs) ApproveProjectAccess(org, project, id string) string
- func (u *URLs) AuthCLISuccessUI() string
- func (u *URLs) AuthLogin(redirect string) string
- func (u *URLs) AuthLoginCallback() string
- func (u *URLs) AuthLogout() string
- func (u *URLs) AuthLogoutCallback() string
- func (u *URLs) AuthLogoutProvider(redirect string) string
- func (u *URLs) AuthVerifyDeviceUI(query map[string]string) string
- func (u *URLs) AuthVerifyEmailUI() string
- func (u *URLs) AuthWithToken(tokenStr, redirect string) string
- func (u *URLs) DenyProjectAccess(org, project, id string) string
- func (u *URLs) Embed(query map[string]string) (string, error)
- func (u *URLs) External() string
- func (u *URLs) Frontend() string
- func (u *URLs) GithubAuth(remote string) string
- func (u *URLs) GithubAuthCallback() string
- func (u *URLs) GithubConnect(remote string) string
- func (u *URLs) GithubConnectRequestUI(remote string) string
- func (u *URLs) GithubConnectRetryUI(remote string) string
- func (u *URLs) GithubConnectSuccessUI(autoclose bool) string
- func (u *URLs) GithubConnectUI(redirect string) string
- func (u *URLs) GithubRetryAuthUI(remote, username string) string
- func (u *URLs) IsHTTPS() bool
- func (u *URLs) MagicAuthTokenOpen(org, project, token string) string
- func (u *URLs) Organization(org string) string
- func (u *URLs) OrganizationInviteAccept(org string) string
- func (u *URLs) Project(org, project string) string
- func (u *URLs) ProjectInviteAccept(org, project string) string
- func (u *URLs) ReportEdit(org, project, report string) string
- func (u *URLs) ReportExport(org, project, report string) string
- func (u *URLs) ReportOpen(org, project, report string, executionTime time.Time) string
- func (u *URLs) WithCustomDomain(domain string) *URLs
- func (u *URLs) WithCustomDomainFromRedirectURL(redirectURL string) *URLs
- type UpdateDeploymentOptions
Constants ¶
const DeviceAuthCodeTTL = 10 * time.Minute
Variables ¶
var ( ErrUserIsNotCollaborator = fmt.Errorf("user is not a collaborator for the repository") ErrGithubInstallationNotFound = fmt.Errorf("github installation not found") )
Functions ¶
This section is empty.
Types ¶
type AuthToken ¶ added in v0.23.0
AuthToken is the interface package admin uses to provide a consolidated view of a token string and its DB model.
type DeploymentAnnotations ¶ added in v0.43.0
type DeploymentAnnotations struct {
// contains filtered or unexported fields
}
func (*DeploymentAnnotations) ToMap ¶ added in v0.47.4
func (da *DeploymentAnnotations) ToMap() map[string]string
type Github ¶ added in v0.25.0
type Github interface { AppClient() *github.Client InstallationClient(installationID int64) (*github.Client, error) InstallationToken(ctx context.Context, installationID int64) (string, error) }
Github exposes the features we require from the Github API.
type IssueMagicAuthTokenOptions ¶ added in v0.47.0
type IssueMagicAuthTokenOptions struct { ProjectID string TTL *time.Duration CreatedByUserID *string Attributes map[string]any ResourceType string ResourceName string FilterJSON string Fields []string State string Title string }
IssueMagicAuthTokenOptions provides options for IssueMagicAuthToken.
type Options ¶
type Options struct { DatabaseDriver string DatabaseDSN string DatabaseEncryptionKeyring string ExternalURL string FrontendURL string ProvisionerSetJSON string DefaultProvisioner string VersionNumber string VersionCommit string MetricsProjectOrg string MetricsProjectName string AutoscalerCron string }
type Service ¶
type Service struct { DB database.DB Jobs jobs.Client URLs *URLs ProvisionerSet map[string]provisioner.Provisioner Email *email.Client Github Github AI ai.Client Assets *storage.BucketHandle Used *usedFlusher Logger *zap.Logger VersionNumber string VersionCommit string AutoscalerCron string Biller billing.Biller PaymentProvider payment.Provider // contains filtered or unexported fields }
func (*Service) CheckBlockingBillingErrors ¶ added in v0.50.0
func (*Service) CleanupSubscriptionBillingIssues ¶ added in v0.50.0
CleanupSubscriptionBillingIssues removes subscription related billing issues
func (*Service) CleanupTrialBillingIssues ¶ added in v0.50.0
CleanupTrialBillingIssues removes trial related billing issues
func (*Service) CreateOrUpdateUser ¶ added in v0.23.0
func (*Service) CreateOrganizationForUser ¶ added in v0.24.0
func (*Service) CreateProject ¶ added in v0.23.0
func (s *Service) CreateProject(ctx context.Context, org *database.Organization, opts *database.InsertProjectOptions) (*database.Project, error)
CreateProject creates a new project and provisions and reconciles a prod deployment for it.
func (*Service) GetGithubInstallation ¶ added in v0.24.0
GetGithubInstallation returns a non zero Github installation ID if the Github App is installed on the repository and is not in suspended state The githubURL should be a HTTPS URL for a Github repository without the .git suffix.
func (*Service) HibernateDeployments ¶ added in v0.29.1
HibernateDeployments tears down unused deployments
func (*Service) HibernateProject ¶ added in v0.47.4
func (s *Service) HibernateProject(ctx context.Context, proj *database.Project) (*database.Project, error)
HibernateProject hibernates a project by tearing down its prod deployment.
func (*Service) InitOrganizationBilling ¶ added in v0.48.0
func (s *Service) InitOrganizationBilling(ctx context.Context, org *database.Organization) (*database.Organization, error)
func (*Service) IssueDeploymentAuthToken ¶ added in v0.36.0
func (s *Service) IssueDeploymentAuthToken(ctx context.Context, deploymentID string, ttl *time.Duration) (AuthToken, error)
IssueDeploymentAuthToken generates and persists a new auth token for a deployment.
func (*Service) IssueDeviceAuthCode ¶ added in v0.24.0
func (*Service) IssueMagicAuthToken ¶ added in v0.47.0
func (s *Service) IssueMagicAuthToken(ctx context.Context, opts *IssueMagicAuthTokenOptions) (AuthToken, error)
IssueMagicAuthToken generates and persists a new magic auth token for a project.
func (*Service) IssueRuntimeManagementToken ¶ added in v0.47.5
func (*Service) IssueServiceAuthToken ¶ added in v0.31.0
func (s *Service) IssueServiceAuthToken(ctx context.Context, serviceID string, ttl *time.Duration) (AuthToken, error)
IssueServiceAuthToken generates and persists a new auth token for a service.
func (*Service) IssueUserAuthToken ¶ added in v0.23.0
func (s *Service) IssueUserAuthToken(ctx context.Context, userID, clientID, displayName string, representingUserID *string, ttl *time.Duration) (AuthToken, error)
IssueUserAuthToken generates and persists a new auth token for a user.
func (*Service) LookupAlert ¶ added in v0.41.0
func (s *Service) LookupAlert(ctx context.Context, depl *database.Deployment, alertName string) (*runtimev1.AlertSpec, error)
LookupAlert fetches a alert's spec from a runtime deployment.
func (*Service) LookupGithubRepoForUser ¶ added in v0.24.0
func (s *Service) LookupGithubRepoForUser(ctx context.Context, installationID int64, githubURL, gitUsername string) (*github.Repository, error)
LookupGithubRepoForUser returns a Github repository iff the Github App is installed on the repository and user is a collaborator of the project. The githubURL should be a HTTPS URL for a Github repository without the .git suffix.
func (*Service) LookupReport ¶ added in v0.37.0
func (s *Service) LookupReport(ctx context.Context, depl *database.Deployment, reportName string) (*runtimev1.ReportSpec, error)
LookupReport fetches a report's spec from a runtime deployment.
func (*Service) NewDeploymentAnnotations ¶ added in v0.43.0
func (s *Service) NewDeploymentAnnotations(org *database.Organization, proj *database.Project) DeploymentAnnotations
func (*Service) OpenMetricsProject ¶ added in v0.43.0
OpenMetricsProject opens a client for accessing the metrics project. If a metrics project is not configured, it returns false for the second return value. The returned client has a TTL of 30 minutes. TODO: Encapsulate token refresh logic in the metrics client.
func (*Service) OpenRuntimeClient ¶ added in v0.47.0
func (*Service) OrganizationPermissionsForDeployment ¶ added in v0.36.0
func (s *Service) OrganizationPermissionsForDeployment(ctx context.Context, orgID, deploymentID string) (*adminv1.OrganizationPermissions, error)
OrganizationPermissionsForDeployment resolves organization permissions for a deployment. A deployment does not get any permissions on the org it belongs to. It only has permissions on the project it belongs to.
func (*Service) OrganizationPermissionsForMagicAuthToken ¶ added in v0.47.0
func (s *Service) OrganizationPermissionsForMagicAuthToken(ctx context.Context, orgID, tokenProjectID string) (*adminv1.OrganizationPermissions, error)
OrganizationPermissionsForMagicAuthToken resolves organization permissions for a magic auth token in the specified project. It grants basic read access to only the org of the project the token belongs to.
func (*Service) OrganizationPermissionsForService ¶ added in v0.33.2
func (s *Service) OrganizationPermissionsForService(ctx context.Context, orgID, serviceID string) (*adminv1.OrganizationPermissions, error)
OrganizationPermissionsForService resolves organization permissions for a service. A service currently gets full permissions on the org they belong to.
func (*Service) OrganizationPermissionsForUser ¶ added in v0.33.2
func (s *Service) OrganizationPermissionsForUser(ctx context.Context, orgID, userID string) (*adminv1.OrganizationPermissions, error)
OrganizationPermissionsForUser resolves organization permissions for a user.
func (*Service) ProcessGithubEvent ¶ added in v0.23.0
ProcessGithubEvent processes a Github event (usually received over webhooks). After validating that the event is a valid Github event, it moves further processing to the background and returns a nil error.
func (*Service) ProjectPermissionsForDeployment ¶ added in v0.36.0
func (s *Service) ProjectPermissionsForDeployment(ctx context.Context, projectID, deploymentID string, orgPerms *adminv1.OrganizationPermissions) (*adminv1.ProjectPermissions, error)
ProjectPermissionsForDeployment resolves project permissions for a deployment. A deployment currently gets full read and no write permissions on the project it belongs to.
func (*Service) ProjectPermissionsForMagicAuthToken ¶ added in v0.47.0
func (s *Service) ProjectPermissionsForMagicAuthToken(ctx context.Context, projectID string, tkn *database.MagicAuthToken) (*adminv1.ProjectPermissions, error)
ProjectPermissionsForMagicAuthToken resolves project permissions for a magic auth token.
func (*Service) ProjectPermissionsForService ¶ added in v0.33.2
func (s *Service) ProjectPermissionsForService(ctx context.Context, projectID, serviceID string, orgPerms *adminv1.OrganizationPermissions) (*adminv1.ProjectPermissions, error)
ProjectPermissionsService resolves project permissions for a service. A service currently gets full permissions on all projects in the org they belong to.
func (*Service) ProjectPermissionsForUser ¶ added in v0.33.2
func (s *Service) ProjectPermissionsForUser(ctx context.Context, projectID, userID string, orgPerms *adminv1.OrganizationPermissions) (*adminv1.ProjectPermissions, error)
ProjectPermissionsForUser resolves project permissions for a user.
func (*Service) RaiseNewOrgBillingIssues ¶ added in v0.50.0
func (s *Service) RaiseNewOrgBillingIssues(ctx context.Context, orgID string, creationTime time.Time, hasPaymentMethod, hasBillableAddress, hasSubscription bool) error
RaiseNewOrgBillingIssues raises billing issues for a new organization
func (*Service) RedeployProject ¶ added in v0.49.0
func (s *Service) RedeployProject(ctx context.Context, proj *database.Project, prevDepl *database.Deployment) (*database.Project, error)
RedeployProject de-provisions and re-provisions a project's prod deployment.
func (*Service) RepairOrganizationBilling ¶ added in v0.50.0
func (s *Service) RepairOrganizationBilling(ctx context.Context, org *database.Organization, initSub bool) (*database.Organization, *billing.Subscription, error)
RepairOrganizationBilling repairs billing for an organization by checking if customer exists in billing systems, if not creating new. Useful for migrating existing orgs to billing system and in rare case when InitOrganizationBilling fails in the middle
func (*Service) ResolveLatestRuntimeVersion ¶ added in v0.44.0
func (*Service) RevokeAuthToken ¶ added in v0.23.0
RevokeAuthToken removes an auth token from persistent storage.
func (*Service) StartTrial ¶ added in v0.50.0
func (s *Service) StartTrial(ctx context.Context, org *database.Organization) (*database.Organization, *billing.Subscription, error)
func (*Service) TeardownDeployment ¶ added in v0.47.2
func (*Service) TeardownProject ¶ added in v0.23.0
TeardownProject tears down a project and all its deployments.
func (*Service) TriggerParser ¶ added in v0.49.0
TriggerParser triggers the deployment's project parser to do a new pull and parse.
func (*Service) TriggerParserAndAwaitResource ¶ added in v0.49.0
func (s *Service) TriggerParserAndAwaitResource(ctx context.Context, depl *database.Deployment, name, kind string) error
TriggerParserAndAwaitResource triggers the parser and polls the runtime until the given resource's spec version has been updated (or ctx is canceled).
func (*Service) TriggerReport ¶ added in v0.37.0
func (s *Service) TriggerReport(ctx context.Context, depl *database.Deployment, report string) (err error)
TriggerReport triggers an ad-hoc run of a report
func (*Service) UpdateDeployment ¶ added in v0.43.0
func (s *Service) UpdateDeployment(ctx context.Context, depl *database.Deployment, opts *UpdateDeploymentOptions) error
func (*Service) UpdateOrgDeploymentAnnotations ¶ added in v0.32.0
func (s *Service) UpdateOrgDeploymentAnnotations(ctx context.Context, org *database.Organization) error
UpdateOrgDeploymentAnnotations iterates over projects of the given org and updates annotations of corresponding deployments with the new organization name NOTE : this does not trigger reconcile.
func (*Service) UpdateProject ¶ added in v0.23.0
func (s *Service) UpdateProject(ctx context.Context, proj *database.Project, opts *database.UpdateProjectOptions) (*database.Project, error)
UpdateProject updates a project and any impacted deployments. It runs a reconcile if deployment parameters (like branch or variables) have been changed and reconcileDeployment is set.
func (*Service) ValidateAuthToken ¶ added in v0.23.0
ValidateAuthToken validates an auth token against persistent storage.
func (*Service) ValidateRuntimeVersion ¶ added in v0.44.0
type URLs ¶ added in v0.49.0
type URLs struct {
// contains filtered or unexported fields
}
URLs centralizes parsing and formatting of URLs for the admin service.
There are several complexities around URL handling in Rill:
- The frontend may run on a different host than the admin service (e.g. ui.rilldata.com vs. admin.rilldata.com).
- We support custom domains for specific orgs (e.g. analytics.mycompany.com instead of ui.rilldata.com/mycompany).
- The admin service sends transactional emails that link to the frontend, such as project invites.
- The admin service is also responsible for sending transactional emails on behalf of the runtime, which also link to the frontend, such as for alerts and reports.
- We need to ensure correct redirects and callbacks for the auth service (on auth.rilldata.com) and Github. These services have fixed callback URLs on the admin service's primary external URL, which complicates custom domain handling.
For orgs with a custom domain configured (using the CLI command `rill sudo org set-custom-domain`), we require the admin service and frontend to be reachable on the custom domain using the following load balancer rules:
- The admin service must be reachable at the `/api` path prefix on the custom domain. The `/api` prefix should be removed by the load balancer before proxying to the admin service.
- The frontend must be reachable at all other paths on the custom domain.
func NewURLs ¶ added in v0.49.0
NewURLs creates a new URLs. The provided URLs should include the scheme, host, optional port, and optional path prefix. The provided URLs should be the primary external and frontend URL for the Rill service. The returned *URLs will rewrite them as needed for custom domains.
func (*URLs) AlertEdit ¶ added in v0.49.0
AlertEdit returns the URL for editing an alert in the frontend.
func (*URLs) AlertOpen ¶ added in v0.49.0
AlertOpen returns the URL for opening an alert in the frontend.
func (*URLs) ApproveProjectAccess ¶ added in v0.49.0
ApproveProjectAccess returns the frontend URL for approving a project access request.
func (*URLs) AuthCLISuccessUI ¶ added in v0.49.0
AuthCLISuccessUI returns the frontend URL to redirect to after successful CLI authentication.
func (*URLs) AuthLogin ¶ added in v0.49.0
AuthLogin returns the URL that starts the redirects to the auth service for login.
func (*URLs) AuthLoginCallback ¶ added in v0.49.0
AuthLoginCallback returns the URL for the OAuth2 callback.
func (*URLs) AuthLogout ¶ added in v0.49.0
AuthLogout returns the URL that starts the logout redirects.
func (*URLs) AuthLogoutCallback ¶ added in v0.49.0
AuthLogoutCallback returns the URL for the logout callback.
func (*URLs) AuthLogoutProvider ¶ added in v0.49.0
AuthLogoutProvider returns the URL that starts the logout redirects against the external auth provider.
func (*URLs) AuthVerifyDeviceUI ¶ added in v0.49.0
AuthVerifyDeviceUI returns the frontend URL for the device auth verification page.
func (*URLs) AuthVerifyEmailUI ¶ added in v0.49.0
AuthVerifyEmailUI returns the frontend URL for the verify email page.
func (*URLs) AuthWithToken ¶ added in v0.49.0
AuthWithToken returns a URL that sets the auth cookie to the provided token. Providing a redirect URL is optional.
func (*URLs) DenyProjectAccess ¶ added in v0.49.0
DenyProjectAccess returns the frontend URL for denying a project access request.
func (*URLs) GithubAuth ¶ added in v0.49.0
GithubAuth returns the URL that starts the Github auth redirects.
func (*URLs) GithubAuthCallback ¶ added in v0.49.0
GithubAuthCallback returns the URL for the Github auth callback.
func (*URLs) GithubConnect ¶ added in v0.49.0
GithubConnect returns the URL that starts the Github connect redirects.
func (*URLs) GithubConnectRequestUI ¶ added in v0.49.0
GithubConnectRequestUI returns the page in the Rill frontend for requesting a Github connect.
func (*URLs) GithubConnectRetryUI ¶ added in v0.49.0
GithubConnectRetryUI returns the page in the Rill frontend for retrying the Github connect flow.
func (*URLs) GithubConnectSuccessUI ¶ added in v0.49.0
GithubConnectSuccessUI returns the page in the Rill frontend for a successful Github connect.
func (*URLs) GithubConnectUI ¶ added in v0.49.0
GithubConnectUI returns the page in the Rill frontend for starting the Github connect flow.
func (*URLs) GithubRetryAuthUI ¶ added in v0.49.0
GithubRetryAuthUI returns the page in the Rill frontend for retrying the Github auth flow.
func (*URLs) IsHTTPS ¶ added in v0.49.0
IsHTTPS returns true if the admin service's external URL uses HTTPS.
func (*URLs) MagicAuthTokenOpen ¶ added in v0.49.0
MagicAuthTokenOpen returns the frontend URL for opening a magic auth token.
func (*URLs) Organization ¶ added in v0.49.0
Organization returns the URL for an org in the frontend.
func (*URLs) OrganizationInviteAccept ¶ added in v0.49.0
OrganizationInviteAccept returns the URL for accepting an organization invite.
func (*URLs) ProjectInviteAccept ¶ added in v0.49.0
ProjectInviteAccept returns the URL for accepting a project invite.
func (*URLs) ReportEdit ¶ added in v0.49.0
ReportEdit returns the URL for editing a report in the frontend.
func (*URLs) ReportExport ¶ added in v0.49.0
ReportExport returns the URL for exporting a report in the frontend.
func (*URLs) ReportOpen ¶ added in v0.49.0
ReportOpen returns the URL for opening a report in the frontend.
func (*URLs) WithCustomDomain ¶ added in v0.49.0
WithCustomDomain returns a copy that generates URLs for the provided custom domain (as described in the type doc). The result automatically generates correct URLs also for the few endpoints that must always use the non-custom external URL (such as AuthLogin).
func (*URLs) WithCustomDomainFromRedirectURL ¶ added in v0.49.0
WithCustomDomainFromURL attempts to infer a custom domain from a redirect URL. If it succeeds, it passes the custom domain to WithCustomDomain and returns the result. If it does not detect a custom domain in the redirect URL, or the redirect URL is invalid, it fails silently by returning itself unchanged.