server

package
v0.0.0-...-95bf05a Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteUsersWithoutDevices

func DeleteUsersWithoutDevices(ctx context.Context, repo repository.Repository) error

func GetCallbackUrl

func GetCallbackUrl(c context.Context, client *http.Client, url string) error

GetCallbackUrl makes a GET request to the given URL If the URL is empty, it returns nil. If the request fails, it returns an error.

Types

type CreateChainRequestV1

type CreateChainRequestV1 struct {
	DeviceName string `json:"deviceName"`
}

type CreateChainRequestV2

type CreateChainRequestV2 struct {
	DeviceName string `json:"deviceName"`
}

type DeviceListResponseV1

type DeviceListResponseV1 struct {
	Devices []DeviceMessageV1 `json:"devices"`
}

type DeviceMessageV1

type DeviceMessageV1 struct {
	DeviceId   int64  `json:"deviceId"`
	DeviceName string `json:"deviceName"`
}

type FeederServer

type FeederServer struct {
	Repo repository.Repository

	Router *gin.Engine
	// contains filtered or unexported fields
}

func NewServerWith

func NewServerWith(
	repo repository.Repository,
	cache *cache.Cache,
	healthCallbackUrl string,
) (*FeederServer, error)

func NewServerWithPostgres

func NewServerWithPostgres(connString string, healthCallbackUrl string) (*FeederServer, error)

func (*FeederServer) Close

func (s *FeederServer) Close() error

func (*FeederServer) ServeHTTP

func (s *FeederServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

type GetFeedsResponseV1

type GetFeedsResponseV1 struct {
	ContentHash int64  `json:"hash"`
	Encrypted   string `json:"encrypted"`
}

type GetReadmarksResponseV1

type GetReadmarksResponseV1 struct {
	ReadMarks []ReadMarkV1 `json:"readMarks"`
}

type Janitor

type Janitor struct {
	Interval time.Duration
	Stop     chan bool
	// contains filtered or unexported fields
}

func NewJanitor

func NewJanitor(
	interval time.Duration,
	startCallbackUrl string,
	endCallbackUrl string,
) *Janitor

func (*Janitor) Halt

func (j *Janitor) Halt()

func (*Janitor) Run

func (j *Janitor) Run(repo repository.Repository)

func (*Janitor) RunOnce

func (j *Janitor) RunOnce(repo repository.Repository)

type JoinChainRequestV1

type JoinChainRequestV1 struct {
	DeviceName string `json:"deviceName"`
}

type JoinChainRequestV2

type JoinChainRequestV2 struct {
	UserId     uuid.UUID `json:"userId"`
	DeviceName string    `json:"deviceName"`
}

type JoinChainResponseV1

type JoinChainResponseV1 struct {
	SyncCode string `json:"syncCode"`
	DeviceId int64  `json:"deviceId"`
}

type MigrateRequestV2

type MigrateRequestV2 struct {
	SyncCode   string `json:"syncCode"`
	DeviceId   int64  `json:"deviceId"`
	DeviceName string `json:"deviceName"`
}

type ReadMarkV1

type ReadMarkV1 struct {
	Timestamp int64  `json:"timestamp"`
	Encrypted string `json:"encrypted"`
}

type SendReadMarkV1

type SendReadMarkV1 struct {
	Encrypted string `json:"encrypted"`
}

type SendReadMarksRequestV1

type SendReadMarksRequestV1 struct {
	ReadMarks []SendReadMarkV1 `json:"items"`
}

type UpdateFeedsRequestV1

type UpdateFeedsRequestV1 struct {
	// Weird JSON. Needs changing in v2
	ContentHash int64  `json:"contentHash"`
	Encrypted   string `json:"encrypted"`
}

type UpdateFeedsResponseV1

type UpdateFeedsResponseV1 struct {
	ContentHash int64 `json:"hash"`
}

type UserDeviceResponseV2

type UserDeviceResponseV2 struct {
	UserId     uuid.UUID `json:"userId"`
	DeviceId   uuid.UUID `json:"deviceId"`
	DeviceName string    `json:"deviceName"`
}

Jump to

Keyboard shortcuts

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