path

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PartActor is the noun used in a path for an actor
	PartActor = "actor"
	// PartAdmin is used in a path for administrative tasks.
	PartAdmin = "admin"
	// PartAccount is used in a path for account tasks.
	PartAccount = "account"
	// PartApp is the noun used in a path for a web app
	PartApp = "app"
	// PartBlock is used in a path for block.
	PartBlock = "block"
	// PartBlocks is used in a path for blocks.
	PartBlocks = "blocks"
	// PartCallback is used in a path for callback.
	PartCallback = "callback"
	// PartExport is used in a path for export.
	PartExport = "export"
	// PartFollowers is the noun used in a path for an actor's followers
	PartFollowers = "followers"
	// PartFollowing is the noun used in a path for actors following an actor
	PartFollowing = "following"
	// PartInbox is the noun used in a path for an actor's inbox
	PartInbox = "inbox"
	// PartInstance is used in a path for instances.
	PartInstance = "instance"
	// PartJob is used in a path for job.
	PartJob = "job"
	// PartLog is used in a path for logs.
	PartLog = "log"
	// PartLogin is used in a path for login.
	PartLogin = "login"
	// PartLogout is used in a path for logout.
	PartLogout = "logout"
	// PartNodeinfo is the noun used in a path for a node info object
	PartNodeinfo = "nodeinfo"
	// PartOauth is used in a path for oauth.
	PartOauth = "oauth"
	// PartPublicKey is the noun used in a path for an actor's public key
	PartPublicKey = "main-key"
	// PartSettings is used in a path for settings page.
	PartSettings = "settings"
	// PartStatistics is used in a path for stats pages.
	PartStatistics = "stats"
	// PartWebFinger is the noun used in a path for web finger
	PartWebFinger = "webfinger"
	// PartWellKnown is the noun used in a well known path
	PartWellKnown = ".well-known"
)
View Source
const (
	// APActor is the path to the relay actor
	APActor = "/" + PartActor
	// APInbox is the path to the relay inbox
	APInbox = "/" + PartInbox
	// APNodeInfo20 is the path to the node info 2.0 schema
	APNodeInfo20 = "/" + PartNodeinfo + "/2.0"
	// APWellKnownNodeInfo is the path to the well known node info endpoint
	APWellKnownNodeInfo = "/" + PartWellKnown + "/" + PartNodeinfo
	// APWellKnownWebFinger is the path to the well known web finger endpoint
	APWellKnownWebFinger = "/" + PartWellKnown + "/" + PartWebFinger
)
View Source
const (

	// App is the path for the web app.
	App = "/" + PartApp

	// AppBlocks is the path for the blocks page.
	AppBlocks = App + AppSubBlocks
	// AppSubBlocks is the sub path for the blocks page.
	AppSubBlocks = "/" + PartBlocks
	// AppSubCallbackOauth is the sub path for an oauth callback.
	AppSubCallbackOauth = "/" + PartCallback + "/" + PartOauth + "/" + VarInstance
	// AppPreCallbackOauth is the prefix path for an oauth callback.
	AppPreCallbackOauth = App + "/" + PartCallback + "/" + PartOauth + "/"
	// AppHome is the path for the home page.
	AppHome = App + AppSubHome
	// AppSubHome is the sub path for the home page.
	AppSubHome = "/"
	// AppInstance is the path for the login page.
	AppInstance = App + AppSubInstance
	// AppSubInstance is the sub path for the login page.
	AppSubInstance = "/" + PartInstance
	// AppLog is the path for the login page.
	AppLog = App + AppSubLog
	// AppSubLog is the sub path for the login page.
	AppSubLog = "/" + PartLog
	// AppLogin is the path for the login page.
	AppLogin = App + AppSubLogin
	// AppSubLogin is the sub path for the login page.
	AppSubLogin = "/" + PartLogin
	// AppLogout is the path for the logout page.
	AppLogout = App + AppSubLogout
	// AppSubLogout is the sub path for the logout page.
	AppSubLogout = "/" + PartLogout
	// AppSettings is the path for the settings page.
	AppSettings = App + AppSubSettings
	// AppSubSettings is the sub path for the settings page.
	AppSubSettings = "/" + PartSettings

	// AppAdmin is the path for the admin page.
	AppAdmin = App + "/" + PartAdmin
	// AppSubAdmin is the sub path for the admin page.
	AppSubAdmin = "/" + PartAdmin
	// AppAdminAccount is the path for the admin account page.
	AppAdminAccount = AppAdmin + AppAdminSubAccount
	// AppAdminSubAccount is the sub path for the admin account page.
	AppAdminSubAccount = "/" + PartAccount
	// AppAdminBlock is the path for the admin blocks page.
	AppAdminBlock = AppAdmin + AppAdminSubBlock
	// AppAdminSubBlock is the sub path for the admin blocks page.
	AppAdminSubBlock = "/" + PartBlock
	// AppAdminBlockExport is the path for the admin blocks export page.
	AppAdminBlockExport = AppAdmin + AppAdminSubBlockExport
	// AppAdminSubBlockExport is the sub path for the admin blocks export page.
	AppAdminSubBlockExport = AppAdminSubBlock + "/" + PartExport
	// AppAdminBlockExportCSV is the path for the admin blocks export page.
	AppAdminBlockExportCSV = AppAdmin + AppAdminSubBlockExportCSV
	// AppAdminSubBlockExportCSV is the sub path for the admin blocks export page.
	AppAdminSubBlockExportCSV = AppAdminSubBlockExport + "." + string(libhttp.SuffixTextCSV)
	// AppAdminBlockExportJSON is the path for the admin blocks export page.
	AppAdminBlockExportJSON = AppAdmin + AppAdminSubBlockExportJSON
	// AppAdminSubBlockExportJSON is the sub path for the admin blocks export page.
	AppAdminSubBlockExportJSON = AppAdminSubBlockExport + "." + string(libhttp.SuffixAppJSON)
	// AppAdminHome is the path for the home page.
	AppAdminHome = AppAdmin + AppAdminSubHome
	// AppAdminSubHome is the sub path for the home page.
	AppAdminSubHome = "/"
	// AppAdminInstance is the path for the admin instances page.
	AppAdminInstance = AppAdmin + AppAdminSubInstance
	// AppAdminSubInstance is the sub path for the admin instances page.
	AppAdminSubInstance = "/" + PartInstance
	// AppAdminPreInstanceView is the prefix path for the admin instance view page.
	AppAdminPreInstanceView = AppAdmin + AppAdminSubInstance + "/"
	// AppAdminSubInstanceView is the sub path for the admin instance view page.
	AppAdminSubInstanceView = AppAdminSubInstance + "/" + VarInstance
	// AppAdminJob is the path for the admin jobs page.
	AppAdminJob = AppAdmin + AppAdminSubJob
	// AppAdminSubJob is the sub path for the admin jobs page.
	AppAdminSubJob = "/" + PartJob
	// AppAdminStatistics is the path for the admin stats page.
	AppAdminStatistics = AppAdmin + AppAdminSubStatistics
	// AppAdminSubStatistics is the sub path for the admin stats page.
	AppAdminSubStatistics = "/" + PartStatistics
)
View Source
const (
	// VarInstanceID is the id of the instance variable.
	VarInstanceID = "instance"
	// VarInstance is the var path of the instance variable.
	VarInstance = "{" + VarInstanceID + ":" + reToken + "}"
)
View Source
const (
	// Robots is the path to the relay actor
	Robots = "/robots.txt"
)

Variables

View Source
var (
	// ReAppAdminPre matches the admin home page.
	ReAppAdminPre = regexp.MustCompile(fmt.Sprintf(`^?%s`, AppAdmin))
	// ReAppAdminHome matches the admin home page.
	ReAppAdminHome = regexp.MustCompile(fmt.Sprintf(`^?%s$`, AppAdminHome))
	// ReAppAdminAccountPre matches the admin instances page.
	ReAppAdminAccountPre = regexp.MustCompile(fmt.Sprintf(`^?%s`, AppAdminAccount))
	// ReAppAdminBlockPre matches the admin block page.
	ReAppAdminBlockPre = regexp.MustCompile(fmt.Sprintf(`^?%s`, AppAdminBlock))
	// ReAppAdminInstancesPre matches the admin instances page.
	ReAppAdminInstancesPre = regexp.MustCompile(fmt.Sprintf(`^?%s`, AppAdminInstance))
	// ReAppAdminJobPre matches the admin jobs page.
	ReAppAdminJobPre = regexp.MustCompile(fmt.Sprintf(`^?%s`, AppAdminJob))
	// ReAppAdminStatisticsPre matches the admin statistics page.
	ReAppAdminStatisticsPre = regexp.MustCompile(fmt.Sprintf(`^?%s`, AppAdminStatistics))

	// ReAppBlocks matches the blocks page.
	ReAppBlocks = regexp.MustCompile(fmt.Sprintf(`^?%s$`, AppBlocks))
	// ReAppHome matches the Home page.
	ReAppHome = regexp.MustCompile(fmt.Sprintf(`^?%s$`, AppHome))
	// ReAppInstance matches the my instance page.
	ReAppInstance = regexp.MustCompile(fmt.Sprintf(`^?%s$`, AppInstance))
	// ReAppSettings matches the settings page.
	ReAppSettings = regexp.MustCompile(fmt.Sprintf(`^?%s$`, AppSettings))
)

Functions

func GenActor

func GenActor(domain string) *url.URL

GenActor returns a url for an actor

func GenAppAdminBlockExport

func GenAppAdminBlockExport() string

GenAppAdminBlockExport returns a path for the admin block export page.

func GenAppAdminBlockExportCSV

func GenAppAdminBlockExportCSV() string

GenAppAdminBlockExportCSV returns a path for the admin block export page.

func GenAppAdminBlockExportJSON

func GenAppAdminBlockExportJSON() string

GenAppAdminBlockExportJSON returns a path for the admin block export page.

func GenAppAdminHomePath

func GenAppAdminHomePath() string

GenAppAdminHomePath returns a path for the admin home page.

func GenAppAdminInstanceViewPath added in v0.4.0

func GenAppAdminInstanceViewPath(t string) string

GenAppAdminInstanceViewPath returns a path for the admin instance view page.

func GenAppHomePath

func GenAppHomePath() string

GenAppHomePath returns a path for the home page.

func GenAppLogPath added in v0.3.0

func GenAppLogPath() string

GenAppLogPath returns a path for the log page.

func GenAppLoginPath

func GenAppLoginPath() string

GenAppLoginPath returns a path for the login page.

func GenAppLogoutPath

func GenAppLogoutPath() string

GenAppLogoutPath returns a path for the login page.

func GenAppSettingsPath added in v0.2.0

func GenAppSettingsPath() string

GenAppSettingsPath returns a path for the settings page.

func GenCallbackOauth

func GenCallbackOauth(domain, instanceToken string) *url.URL

GenCallbackOauth returns a url for a callback oauth

func GenFollowers

func GenFollowers(d string) string

GenFollowers returns a url for an actor's followers

func GenFollowing

func GenFollowing(d string) string

GenFollowing returns a url for actors following an actor

func GenInbox

func GenInbox(domain string) *url.URL

GenInbox returns a url for an actor's inbox

func GenNodeinfo20

func GenNodeinfo20(d string) string

GenNodeinfo20 returns a url for an nodeinfo 2.0 url

func GenPublicKey

func GenPublicKey(d string) string

GenPublicKey returns a url for an actor's public key

func GenWellKnownNodeInfoURL

func GenWellKnownNodeInfoURL(d string) *url.URL

GenWellKnownNodeInfoURL returns a url for well known node info url

Types

This section is empty.

Jump to

Keyboard shortcuts

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