Documentation ¶
Index ¶
- func BaseFileName(path string) string
- func CopyFile(srcPath, dstPath string) error
- func Debug(v ...any)
- func Debugf(format string, v ...any)
- func Error(v ...any)
- func Errorf(v ...any)
- func Fatal(v ...any)
- func FatalIf(err error, v ...any)
- func FileExists(path string) bool
- func Filter[F any](list []F, predicate func(F) bool) []F
- func HashStrings(vals ...string) (string, error)
- func Info(v ...any)
- func Infof(format string, v ...any)
- func Init(level LogLevel, prefix string)
- func Map[F any, G any](list []F, mapper func(F) G) []G
- func Marshal(payload any) (io.Reader, error)
- func MarshalToString(payload any) (string, error)
- func ReadAllString(rdr io.Reader) (string, error)
- func ShortID() string
- func TokenFromFile(path string) (*oauth2.Token, error)
- func Unmarshal[T any](rdr io.Reader) (*T, error)
- func UnmarshalFromString[T any](str string) (*T, error)
- func Warning(v ...any)
- func Warningf(format string, v ...any)
- type LogLevel
- type RequestBuilder
- func (rb *RequestBuilder) Do(ctx context.Context) (*http.Response, error)
- func (rb *RequestBuilder) Get() *RequestBuilder
- func (rb *RequestBuilder) Post() *RequestBuilder
- func (rb *RequestBuilder) SetClient(client *http.Client) *RequestBuilder
- func (rb *RequestBuilder) SetMethod(method string) *RequestBuilder
- func (rb *RequestBuilder) SetParams(params map[string]string) *RequestBuilder
- func (rb *RequestBuilder) SetPayload(payload any) *RequestBuilder
- func (rb *RequestBuilder) SetUrl(url string) *RequestBuilder
- type Set
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BaseFileName ¶
func FileExists ¶
func HashStrings ¶
HashStrings computes the hash of the given strings by hashing the strings together into an int representation and then converting that to a string to keep the resulting string small
func MarshalToString ¶
func TokenFromFile ¶
TokenFromFile will attempt to parse an oauth token at the provided file path
func UnmarshalFromString ¶
Types ¶
type RequestBuilder ¶
type RequestBuilder struct {
// contains filtered or unexported fields
}
func NewRequest ¶
func NewRequest() *RequestBuilder
func (*RequestBuilder) Get ¶
func (rb *RequestBuilder) Get() *RequestBuilder
func (*RequestBuilder) Post ¶
func (rb *RequestBuilder) Post() *RequestBuilder
func (*RequestBuilder) SetClient ¶
func (rb *RequestBuilder) SetClient(client *http.Client) *RequestBuilder
func (*RequestBuilder) SetMethod ¶
func (rb *RequestBuilder) SetMethod(method string) *RequestBuilder
func (*RequestBuilder) SetParams ¶
func (rb *RequestBuilder) SetParams(params map[string]string) *RequestBuilder
func (*RequestBuilder) SetPayload ¶
func (rb *RequestBuilder) SetPayload(payload any) *RequestBuilder
func (*RequestBuilder) SetUrl ¶
func (rb *RequestBuilder) SetUrl(url string) *RequestBuilder
type Set ¶
type Set[K comparable] map[K]struct{}
func NewSet ¶
func NewSet[K comparable](items ...K) Set[K]
Click to show internal directories.
Click to hide internal directories.