imageboard

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Name is the board name
	Name = "Img"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	BoardDelay    string            `json:"boardDelay"`
	StartEnabled  *atomic.Bool      `json:"enabled"`
	Directories   []string          `json:"directories"`
	DirectoryList []*ImageDirectory `json:"directoryList"`
	UseDiskCache  *atomic.Bool      `json:"useDiskCache"`
	UseMemCache   *atomic.Bool      `json:"useMemCache"`
	OnTimes       []string          `json:"onTimes"`
	OffTimes      []string          `json:"offTimes"`
	// contains filtered or unexported fields
}

Config ...

func (*Config) SetDefaults

func (c *Config) SetDefaults()

SetDefaults sets some Config defaults

type ImageBoard

type ImageBoard struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ImageBoard is a board for displaying image files

func New

func New(config *Config, logger *zap.Logger) (*ImageBoard, error)

New ...

func (*ImageBoard) Enabler

func (i *ImageBoard) Enabler() board.Enabler

func (*ImageBoard) GetHTTPHandlers

func (i *ImageBoard) GetHTTPHandlers() ([]*board.HTTPHandler, error)

GetHTTPHandlers ...

func (*ImageBoard) GetRPCHandler

func (i *ImageBoard) GetRPCHandler() (string, http.Handler)

GetRPCHandler ...

func (*ImageBoard) HasPriority

func (i *ImageBoard) HasPriority() bool

HasPriority ...

func (*ImageBoard) InBetween

func (i *ImageBoard) InBetween() bool

InBetween ...

func (*ImageBoard) Name

func (i *ImageBoard) Name() string

Name ...

func (*ImageBoard) Render

func (i *ImageBoard) Render(ctx context.Context, canvas board.Canvas) error

Render ...

func (*ImageBoard) SetJumper

func (i *ImageBoard) SetJumper(j Jumper)

SetJumper sets the jumper function

type ImageDirectory

type ImageDirectory struct {
	Directory string `json:"directory"`
	JumpOnly  bool   `json:"jumpOnly"`
}

ImageDirectory is a configurable directory of images

type Jumper

type Jumper func(ctx context.Context, boardName string) error

Jumper is a function that jumps to a board

type Server

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

Server ...

func (*Server) GetStatus

func (s *Server) GetStatus(ctx context.Context, req *emptypb.Empty) (*pb.StatusResp, error)

GetStatus ...

func (*Server) Jump

func (s *Server) Jump(ctx context.Context, req *pb.JumpReq) (*emptypb.Empty, error)

Jump ...

func (*Server) SetStatus

func (s *Server) SetStatus(ctx context.Context, req *pb.SetStatusReq) (*emptypb.Empty, error)

SetStatus ...

Jump to

Keyboard shortcuts

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