bluesky

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaltHostName = "bsky.social"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bluesky

type Bluesky struct {
	Host     string `json:"host"`
	Handle   string `json:"handle"`
	Password string `json:"password"`
	// contains filtered or unexported fields
}

Bluesky is configuration for Bluesky

func New

func New(path, dir string, wcfg *webpage.Config, logger *log.ZapEventLogger) (*Bluesky, error)

New creates new Bluesky instance.

func Register added in v0.4.0

func Register(ctx context.Context, server, handle, password, baseDir string, logger *log.ZapEventLogger) (*Bluesky, error)

Register functions registers application to mastodon server.

func (*Bluesky) BaseDir

func (cfg *Bluesky) BaseDir() string

BaseDir method returns base directory.

func (*Bluesky) CreateSession

func (cfg *Bluesky) CreateSession(ctx context.Context) error

CreateSession method makes XRPC instance and creates/refreshes session.

func (*Bluesky) Export added in v0.4.0

func (cfg *Bluesky) Export(path string) error

Export methods exports configuration to config file.

func (*Bluesky) Logger

func (cfg *Bluesky) Logger() *zap.Logger

Logger method returns zap.Logger instance.

func (*Bluesky) PostMessage

func (cfg *Bluesky) PostMessage(ctx context.Context, msg *Message) (string, error)

PostMessage method posts message and image files to Bluesky.

func (*Bluesky) Profile added in v0.2.0

func (cfg *Bluesky) Profile(ctx context.Context, actor string) (*bsky.ActorDefs_ProfileViewDetailed, error)

Profile method returns actor's profile information.

func (*Bluesky) ShowProfile

func (cfg *Bluesky) ShowProfile(ctx context.Context, actor string, jsonFlag bool, w io.Writer) error

ShowProfile method outouts actor's profile information to io.Wtiter.

type Message added in v0.2.0

type Message struct {
	Msg        string
	ReplryTo   string
	ImageFiles []string
}

Message is information of post message.

Jump to

Keyboard shortcuts

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