Help us shape the future of Go! Take the 2026 Go Developer Survey

api

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	sync.Mutex
	Conf ApiConfig
	// contains filtered or unexported fields
}

func Init

func Init(conf ApiConfig, lg *logger.Logger) *Api

func (*Api) Get

func (a *Api) Get(req *events.AuthRequest) (*events.AuthResponse, error)

func (*Api) SendAcct

func (a *Api) SendAcct(acct *events.AcctRequest)

func (*Api) SendPostAuth

func (a *Api) SendPostAuth(req events.AuthRequest, resp events.AuthResponse)

type ApiConfig

type ApiConfig struct {
	Auth struct {
		Addresses     []string `yaml:"addresses"`
		AliveChecking struct {
			Enabled        bool          `yaml:"enabled"`
			DisableTimeout time.Duration `yaml:"disable_timeout"`
		} `yaml:"alive_checking"`
		Caching struct {
			Enabled          bool          `yaml:"enabled"`
			ActualizeTimeout time.Duration `yaml:"actualize_timeout"`
			TimeoutExpires   time.Duration `yaml:"expire_timeout"`
		} `yaml:"caching"`
	} `yaml:"auth"`
	PostAuth struct {
		Enabled      bool     `yaml:"enabled"`
		CountReaders int      `yaml:"count_readers"`
		Addresses    []string `yaml:"addresses"`
	} `yaml:"postauth"`
	Acct struct {
		Enabled      bool     `yaml:"enabled"`
		CountReaders int      `yaml:"count_readers"`
		Addresses    []string `yaml:"addresses"`
	} `yaml:"acct"`
	Timeout time.Duration `yaml:"timeout"`
}

type ApiResponse

type ApiResponse struct {
	Data       events.AuthResponse `json:"data"`
	Meta       interface{}         `json:"meta"`
	StatusCode int                 `json:"statusCode"`
}

type PostAuth

type PostAuth struct {
	Request  events.AuthRequest  `json:"request"`
	Response events.AuthResponse `json:"response"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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