Documentation ¶
Overview ¶
Package riposo contains the basic necessities.
Index ¶
- Constants
- Variables
- func ParseEnv(config interface{}) error
- type Epoch
- type ErrCode
- type Helpers
- type HelpersOptions
- type Path
- func (p Path) Contains(other Path) bool
- func (p Path) IsNode() bool
- func (p Path) ObjectID() string
- func (p Path) Parent() Path
- func (p Path) ResourceName() string
- func (p Path) Split() (string, string)
- func (p Path) String() string
- func (p Path) Traverse(fn func(Path))
- func (p Path) WithObjectID(objectID string) Path
Constants ¶
View Source
const ( // Version references the code version. Version = "0.1.0" // APIVersion references the implemented API version. APIVersion = "1.22" )
View Source
const ( Everyone = "system.Everyone" Authenticated = "system.Authenticated" )
Static principals.
Variables ¶
Logger is the default logger for riposo.
Functions ¶
Types ¶
type Epoch ¶
type Epoch int64
Epoch is the number of milliseconds since 1970.
func EpochFromTime ¶
EpochFromTime creates an epoch from time.
func (Epoch) HTTPFormat ¶
HTTPFormat returns a http.Header compatible time string.
type ErrCode ¶
type ErrCode int
ErrCode is a specific internal error code.
const ( ErrCodeMissingAuthToken ErrCode = 104 ErrCodeInvalidAuthToken ErrCode = 105 ErrCodeBadJSON ErrCode = 106 ErrCodeInvalidParameters ErrCode = 107 ErrCodeMissingParameters ErrCode = 108 ErrCodeInvalidPostedData ErrCode = 109 ErrCodeInvalidResourceID ErrCode = 110 ErrCodeMissingResource ErrCode = 111 ErrCodeMissingContentLength ErrCode = 112 ErrCodeRequestTooLarge ErrCode = 113 ErrCodeModifiedMeanwhile ErrCode = 114 ErrCodeMethodNotAllowed ErrCode = 115 ErrCodeVersionNotAvailable ErrCode = 116 ErrCodeClientReachedCapacity ErrCode = 117 ErrCodeForbidden ErrCode = 121 ErrCodeConstraintViolated ErrCode = 122 ErrCodeBackend ErrCode = 201 ErrCodeServiceDeprecated ErrCode = 202 ErrCodeUndefined ErrCode = 999 )
Error codes enum.
type Helpers ¶
type Helpers struct {
// contains filtered or unexported fields
}
Helpers provide access to elementary helper functions.
func CustomHelpers ¶
CustomHelpers inits custom helpers.
type HelpersOptions ¶
type HelpersOptions struct { Identity string // type of identity generator to use SlowHash string // type of slowhash to use }
HelpersOptions are used to configure helpers.
type Path ¶
type Path string
Path represents an object path.
func (Path) ResourceName ¶
ResourceName extracts the resource name.
func (Path) WithObjectID ¶
WithObjectID replaces the objectID of the path and returns the result.
Click to show internal directories.
Click to hide internal directories.