guardian

package
v0.0.0-...-4318582 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

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

Controller definition.

func NewController

func NewController(srv *Service, logger *zap.Logger) *Controller

NewController create a new controler.

func (*Controller) GetCurrentGuardianSet

func (c *Controller) GetCurrentGuardianSet(ctx context.Context) (*GuardianSetDoc, error)

func (*Controller) GetGuardianSet

func (c *Controller) GetGuardianSet(ctx *fiber.Ctx) error

GetGuardianSet handler for the endpoint /api/guardianset/current This endpoint has been migrated from the guardian grpc api.

type GuardianSetDoc

type GuardianSetDoc struct {
	ID        string   `bson:"_id" json:"id"`
	Addresses []string `bson:"addresses" json:"addresses"`
	Index     uint32   `bson:"index" json:"index"`
}

type Repository

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

func NewRepository

func NewRepository(db *mongo.Database, logger *zap.Logger) *Repository

func (*Repository) GetCurrentGuardianSet

func (r *Repository) GetCurrentGuardianSet(ctx context.Context) (*GuardianSetDoc, error)

type Service

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

func NewService

func NewService(dao *Repository, logger *zap.Logger) *Service

func (*Service) GetCurrentGuardianSet

func (s *Service) GetCurrentGuardianSet(ctx context.Context) (*GuardianSetDoc, error)

Jump to

Keyboard shortcuts

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