managers

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	BCAST_ACTION_SECRET_NEW    = BroadcastAction("secret:new")
	BCAST_ACTION_SECRET_CHANGE = BroadcastAction("secret:change")
	BCAST_ACTION_SECRET_REMOVE = BroadcastAction("secret:remove")
	BCAST_ACTION_VAULT_VERSION = BroadcastAction("vault:version")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Broadcast added in v0.0.5

type Broadcast struct {
	Team    string
	Vault   string
	Message []byte
}

type BroadcastAction added in v0.0.5

type BroadcastAction string

type BroadcastPayload added in v0.0.5

type BroadcastPayload struct {
	Action       BroadcastAction              `json:"action"`
	Team         string                       `json:"team,omitempty"`
	Vault        string                       `json:"vault,omitempty"`
	Secret       *models.Secret               `json:"secret,omitempty"`
	VaultVersion map[string]map[string]uint32 `json:"vault_version,omitempty"`
}

type BroadcasterMgr added in v0.0.5

type BroadcasterMgr interface {
	Subscribe(address string) <-chan *Broadcast
	Unsubscribe(address string)
	Send(team, vault string, action BroadcastAction, secret *models.Secret)
	Stop()
}

func NewInternalBroadcasterMgr added in v0.0.5

func NewInternalBroadcasterMgr() BroadcasterMgr

type InternalBroadcasterMgr added in v0.0.5

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

func (*InternalBroadcasterMgr) Send added in v0.0.5

func (ibm *InternalBroadcasterMgr) Send(team, vault string, action BroadcastAction, secret *models.Secret)

func (*InternalBroadcasterMgr) Stop added in v0.0.5

func (ibm *InternalBroadcasterMgr) Stop()

func (*InternalBroadcasterMgr) Subscribe added in v0.0.5

func (ibm *InternalBroadcasterMgr) Subscribe(sid string) <-chan *Broadcast

func (*InternalBroadcasterMgr) Unsubscribe added in v0.0.5

func (ibm *InternalBroadcasterMgr) Unsubscribe(sid string)

type MailMgr

type MailMgr interface {
	SendMail(to string, subject string, data string) error
}

func NewMailMgrNULL

func NewMailMgrNULL() MailMgr

func NewMailMgrSMTP

func NewMailMgrSMTP(server, user, pass, from string) MailMgr

func NewMailMgrSparkpost

func NewMailMgrSparkpost(key, from string, eu bool) MailMgr

type Session

type Session struct {
	Id           string    `json:"id" scaneo:"pk"`
	User         string    `json:"user"`
	Agent        string    `json:"agent"`
	RequiresCSRF bool      `json:"csrf_required"`
	LastAccess   time.Time `json:"last_access"`
	StoreToken   string    `json:"-"`
	LastIp       string    `json:"last_ip"`
}

type SessionMgr

type SessionMgr interface {
	NewSession(userId string, ip string, agent string, csrf bool) (*Session, error)
	UpdateSession(id, ip, agent string) (*Session, error)
	GetSession(id string) (*Session, error)
	DeleteSession(id string) error
	GetAllSessions(userId string) ([]*Session, error)
	DeleteAllSessions(userId string) error
}

func NewSessionMgrDB

func NewSessionMgrDB(dbp *sql.DB) SessionMgr

func NewSessionMgrRedis

func NewSessionMgrRedis(connUrl string, dbId int) (SessionMgr, error)

Jump to

Keyboard shortcuts

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