keyban

package
v0.0.0-...-996fa4a Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: AGPL-3.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 Request

type Request struct {
	Secret string `json:"secret"` // The master key to use.
	Target string `json:"target"` // The target key to ban.
	Banned bool   `json:"banned"` // Whether the target should be banned or not.
}

Request represents a key ban request.

type Response

type Response struct {
	Request uint16 `json:"req,omitempty"`
	Status  int    `json:"status"` // The status of the response
	Banned  bool   `json:"banned"` // Whether the target should be banned or not.
}

Response represents a key ban response.

func (*Response) ForRequest

func (r *Response) ForRequest(id uint16)

ForRequest sets the request ID in the response for matching

type Service

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

Service represents a key blacklisting service.

func New

func New(auth service.Authorizer, keygen service.Decryptor, cluster service.Replicator) *Service

New creates a new key blacklisting service.

func (*Service) OnRequest

func (s *Service) OnRequest(c service.Conn, payload []byte) (service.Response, bool)

OnRequest handles a request to create a link.

Jump to

Keyboard shortcuts

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