Documentation
¶
Overview ¶
Package slink provides tools for slink-based clients.
Index ¶
- Constants
- func CastAnyToArray[T any](v *any) []*T
- func CastAnyToStruct[T any](v *any) *T
- func CastBoolToPointer(v bool) *bool
- func CastInt64ToPointer(v int64) *int64
- func CastStringToPointer(s string) *string
- func GenerateAuthToken(keybytes []byte, claims map[string]any, typ string) ([]byte, error)
- func LexiconTypeFromJSONBytes(data []byte) string
- func MarshalWithLexiconType(t string, v any) ([]byte, error)
- func Now() string
- func ReadJSONFile(name string) (*any, error)
- func RespondWithJSON(w http.ResponseWriter, response any)
- func SetLogLevel(level string) error
- func TruncateShort(s string) string
- func TruncateToLength(s string, maxlen int) string
- func VerifyAuthHeader(ctx context.Context, authHeader string) (*jwt.Token, error)
- func VerifyAuthToken(ctx context.Context, accessToken string) (*jwt.Token, error)
- func Write(w io.Writer, output string, v any) error
- type Blob
- type Bytes
- type Client
- type Link
- type RequestType
Constants ¶
View Source
const ( Query = RequestType(iota) Procedure )
View Source
const ISO8601 = "2006-01-02T15:04:05.000Z"
Variables ¶
This section is empty.
Functions ¶
func CastAnyToArray ¶
func CastAnyToStruct ¶
func CastBoolToPointer ¶
func CastInt64ToPointer ¶
func CastStringToPointer ¶
func GenerateAuthToken ¶
func LexiconTypeFromJSONBytes ¶
LexiconTypeFromJSONBytes extracts the lexicon type from an otherwise-unparsed value.
func MarshalWithLexiconType ¶
MarshalWithLexiconType marshals an object, adding a specified type.
func ReadJSONFile ¶
func RespondWithJSON ¶
func RespondWithJSON(w http.ResponseWriter, response any)
func SetLogLevel ¶
func TruncateShort ¶
func TruncateToLength ¶
func VerifyAuthHeader ¶
func VerifyAuthToken ¶
Types ¶
type Blob ¶
type Blob struct {
LexiconTypeID string `json:"$type,omitempty"`
Ref Link `json:"ref,omitempty"`
MimeType string `json:"mimeType,omitempty"`
Size int64 `json:"size"`
Cid string `json:"cid,omitempty"` // deprecated legacy blob format (see docs linked above).
}
Blob represents the Lexicon "blob" type (https://atproto.com/specs/data-model#blob-type).
type Bytes ¶ added in v0.1.3
type Bytes struct {
Bytes []byte
}
Bytes represents the Lexicon "bytes" type (https://atproto.com/specs/data-model#bytes).
func (Bytes) MarshalJSON ¶ added in v0.1.4
func (*Bytes) UnmarshalJSON ¶ added in v0.1.5
type Link ¶
type Link struct {
LexiconLink string `json:"$link"`
}
Link represents the Lexicon "cid-link" type (https://atproto.com/specs/data-model#link).
type RequestType ¶
type RequestType int
Click to show internal directories.
Click to hide internal directories.