common

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertFrom

func ConvertFrom[
	T, U any,
	P interface {
		*U
		From(*T)
	},
]() func(T) U

func ErrorFromDecodedResponse

func ErrorFromDecodedResponse[T any](method string, yield func() (T, error)) (resp T, err error)

saclient.IsNotFoundError() に対応させる

func ErrorFromDecodedResponseE

func ErrorFromDecodedResponseE(m string, y func() error) (e error)

Wrapper to reduce copy & paste

func FromOpt

func FromOpt[T any, P interface{ Get() (T, bool) }](v P) (ret *T)

generic-ish type cast helper function

func IntoNullable

func IntoNullable[
	T, U any,
	P interface {
		*T
		SetToNull()
		SetTo(u U)
	},
](v *U) (ret T)

generic-ish type cast helper function

func IntoOpt

func IntoOpt[
	T, U any,
	P interface {
		*T
		Reset()
		SetTo(u U)
	},
](v *U) (ret T)

generic-ish type cast helper function

func MapSlice

func MapSlice[T, U any](src []T, f func(T) U) (ret []U)

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

func NewAPIError

func NewAPIError(method string, code int, err error) *Error

func NewError

func NewError(msg string, err error) *Error

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

Jump to

Keyboard shortcuts

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