common

package
v0.0.0-...-cbb00c2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// API.
	APIServer = "https://api.standardnotes.com"
	SyncPath  = "/items/sync" // remote path for making sync calls

	// Type names.
	SNItemTypeNote                 = "Note"
	SNItemTypeTag                  = "Tag"
	SNItemTypeComponent            = "SN|Component"
	SNItemTypeItemsKey             = "SN|ItemsKey"
	SNItemTypeTheme                = "SN|Theme"
	SNItemTypePrivileges           = "SN|Privileges"
	SNItemTypeExtension            = "Extension"
	SNItemTypeSFExtension          = "SF|Extension"
	SNItemTypeSFMFA                = "SF|MFA"
	SNItemTypeSmartTag             = "SN|SmartTag"
	SNItemTypeFileSafeFileMetaData = "SN|FileSafe|FileMetadata"
	SNItemTypeFileSafeIntegration  = "SN|FileSafe|Integration"
	SNItemTypeFileSafeCredentials  = "SN|FileSafe|Credentials" //nolint:gosec
	SNItemTypeUserPreferences      = "SN|UserPreferences"
	SNItemTypeExtensionRepo        = "SN|File"
	SNItemTypeFile                 = "SN|ExtensionRepo"

	// Authentication.
	AuthParamsPath    = "/v2/login-params" // remote path for getting auth parameters
	AuthRegisterPath  = "/v1/users"        // remote path for registering user
	AuthRefreshPath   = "/v1/sessions/refresh"
	SignInPath        = "/v2/login" // remote path for authenticating
	MinPasswordLength = 8           // minimum password length when registering
	// PageSize is the maximum number of items to return with each call.
	PageSize            = 150
	TimeLayout          = "2006-01-02T15:04:05.000Z"
	TimeLayout2         = "2006-01-02T15:04:05.000000Z"
	DefaultSNVersion    = "004"
	DefaultPasswordCost = 110000

	// LOGGING.
	LibName       = "gosn-v2" // name of library used in logging
	MaxDebugChars = 120       // number of characters to display when logging API response body

	// HTTP.
	MaxIdleConnections = 100 // HTTP transport limit
	RequestTimeout     = 30  // HTTP transport limit
	ConnectionTimeout  = 3   // HTTP transport dialer limit
	KeepAliveTimeout   = 60  // HTTP transport dialer limit
	MaxRequestRetries  = 3
)
View Source
const HeaderContentType = "Content-Type"
View Source
const (
	SNAPIContentType = "application/json"
)

Variables

This section is empty.

Functions

func NewHTTPClient

func NewHTTPClient() *retryablehttp.Client

Types

This section is empty.

Jump to

Keyboard shortcuts

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