core

package
v0.1.0-experimental.3 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: BSD-3-Clause Imports: 3 Imported by: 0

README

Core Packages

Package core contains lower level packages as a base for the typesetting stages. Sub-packages of package core implement lower level functionality, which will be imported by the higher level abstractions of the various typesetting stages.

Attention: Packages in core are not allowed to import packags from outside core, except external libraries.

Documentation

Overview

Package core contains lower level packages as a base for the typesetting stages.

Sub-packages of package core implement lower level functionality, which will be imported by the higher level abstractions of the various typesetting stages.

Re-Use

Packages in core are not allowed to import packags from outside core, except external libraries.

BSD License

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of this software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Index

Constants

View Source
const (
	NOERROR     int = 0
	EMISSING    int = 122 // resource does not exist
	EINVALID    int = 123 // validation failed
	ECONNECTION int = 124 // remote resource not connected
	EINTERNAL   int = 125 // internal error
)

General error codes

Variables

This section is empty.

Functions

func Code

func Code(err error) (code int)

Code returns the status code associated with an error. If no status code is found, it returns EINTERNAL. If err is nil, NOERROR is returned.

func Error

func Error(code int, format string, v ...interface{}) error

Error creates an error with an error code and a user-message.

func ErrorWithCode

func ErrorWithCode(err error, code int) error

ErrorWithCode adds an error code to err's error chain. Unlike pkg/errors, ErrorWithCode will wrap nil error.

func UserError

func UserError(err error)

func UserMessage

func UserMessage(err error) string

UserMessage returns the user message associated with an error. If no message is found, it checks StatusCode and returns that message. If err is nil, it returns "".

func WrapError

func WrapError(err error, code int, format string, v ...interface{}) error

WrapError wraps an error in a core error, featuring an error code and a user message. If err is nil, an error denoting NOERROR is returned.

Types

type AppError

type AppError interface {
	error
	ErrorCode() int
	UserMessage() string
}

AppError is an error with an associated error code and a user-message.

Directories

Path Synopsis
Package dimen implements dimensions and units.
Package dimen implements dimensions and units.
Package font is for typeface and font handling.
Package font is for typeface and font handling.
opentype/ot
Package ot provides access to OpenType font tables and features.
Package ot provides access to OpenType font tables and features.
opentype/otlayout
Package otlayout provides access to OpenType font layout features.
Package otlayout provides access to OpenType font layout features.
opentype/otquery
Package otquery queries metrics and other information from OpenType fonts.
Package otquery queries metrics and other information from OpenType fonts.
opentype/otshape
Package otshape is work in progress.
Package otshape is work in progress.
Package hyphenation is a quick and dirty implementation of a hyphenation algorithm.
Package hyphenation is a quick and dirty implementation of a hyphenation algorithm.
Wait for the new filesystem API planned by a Go proposal (from the core team).
Wait for the new filesystem API planned by a Go proposal (from the core team).
resources
Package resources resolves all kinds of resources for an application.
Package resources resolves all kinds of resources for an application.
Package option implements an experimental option type.
Package option implements an experimental option type.
BSD License Copyright (c) 2017–20, Norbert Pillmayer All rights reserved.
BSD License Copyright (c) 2017–20, Norbert Pillmayer All rights reserved.

Jump to

Keyboard shortcuts

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