slackfs

package module
v0.0.0-...-704a793 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2016 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttrFactory

type AttrFactory func(parent *DirNode) (INode, error)

type AttrNode

type AttrNode struct {
	Node
	// contains filtered or unexported fields
}

func NewAttrNode

func NewAttrNode(parent *DirNode, name string, priv interface{}) (*AttrNode, error)

func (*AttrNode) Activate

func (an *AttrNode) Activate() error

func (*AttrNode) Attr

func (an *AttrNode) Attr(a *fuse.Attr)

func (*AttrNode) Dirent

func (n *AttrNode) Dirent() fuse.Dirent

func (*AttrNode) IsDir

func (an *AttrNode) IsDir() bool

func (*AttrNode) ReadAll

func (an *AttrNode) ReadAll(ctx context.Context) ([]byte, error)

type Channel

type Channel struct {
	slack.Channel
	Session
}

func NewChannel

func NewChannel(sc slack.Channel, conn *FSConn) *Channel

func (*Channel) BaseChannel

func (c *Channel) BaseChannel() *slack.BaseChannel

func (*Channel) Id

func (c *Channel) Id() string

func (*Channel) IsOpen

func (c *Channel) IsOpen() bool

func (*Channel) Name

func (c *Channel) Name() string

type DirCreator

type DirCreator func(parent *DirNode, name string, priv interface{}) (*DirNode, error)

DirCreator matches the signature of New{Channel,Group,IM}Dir

type DirNode

type DirNode struct {
	Node
	// contains filtered or unexported fields
}

func NewChannelDir

func NewChannelDir(parent *DirNode, id string, priv interface{}) (*DirNode, error)

func NewDirNode

func NewDirNode(parent *DirNode, name string, priv interface{}) (*DirNode, error)

func NewGroupDir

func NewGroupDir(parent *DirNode, id string, priv interface{}) (*DirNode, error)

func NewIMDir

func NewIMDir(parent *DirNode, id string, priv interface{}) (*DirNode, error)

func NewTeamDir

func NewTeamDir(parent *DirNode, id string, priv interface{}) (*DirNode, error)

func NewUserDir

func NewUserDir(parent *DirNode, id string, priv interface{}) (*DirNode, error)

func (*DirNode) Activate

func (dn *DirNode) Activate() error

func (*DirNode) Attr

func (dn *DirNode) Attr(a *fuse.Attr)

func (*DirNode) Dirent

func (n *DirNode) Dirent() fuse.Dirent

func (*DirNode) IsDir

func (dn *DirNode) IsDir() bool

func (*DirNode) Lookup

func (dn *DirNode) Lookup(ctx context.Context, name string) (fs.Node, error)

func (*DirNode) ReadDirAll

func (dn *DirNode) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error)

type DirOwner

type DirOwner interface {
	DirNode() *DirNode
}

type DirSet

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

func NewDirSet

func NewDirSet(parent *DirNode, name string, create DirCreator, priv interface{}) (ds *DirSet, err error)

func (*DirSet) Activate

func (ds *DirSet) Activate()

func (*DirSet) Add

func (ds *DirSet) Add(id, name string, priv interface{}) error

func (*DirSet) Container

func (ds *DirSet) Container() *DirNode

func (*DirSet) LookupId

func (ds *DirSet) LookupId(id string) *DirNode

type EventHandler

type EventHandler interface {
	Event(evt slack.SlackEvent) (handled bool)
}

type FSConn

type FSConn struct {
	Super *Super
	// contains filtered or unexported fields
}

func NewFSConn

func NewFSConn(token string) (*FSConn, error)

func NewOfflineFSConn

func NewOfflineFSConn(infoPath string) (*FSConn, error)

func (*FSConn) Event

func (conn *FSConn) Event(evt slack.SlackEvent) bool

func (*FSConn) Send

func (fs *FSConn) Send(txtBytes []byte, id string) error

type Group

type Group struct {
	slack.Group
	Session
}

func NewGroup

func NewGroup(sg slack.Group, conn *FSConn) *Group

func (*Group) BaseChannel

func (g *Group) BaseChannel() *slack.BaseChannel

func (*Group) Id

func (g *Group) Id() string

func (*Group) IsOpen

func (g *Group) IsOpen() bool

func (*Group) Name

func (g *Group) Name() string

type HistoryFn

type HistoryFn func(id string, params slack.HistoryParameters) (*slack.History, error)

type IM

type IM struct {
	slack.IM
	Session
	// contains filtered or unexported fields
}

func NewIM

func NewIM(sim slack.IM, conn *FSConn) *IM

func (*IM) BaseChannel

func (im *IM) BaseChannel() *slack.BaseChannel

func (*IM) Id

func (im *IM) Id() string

func (*IM) IsOpen

func (im *IM) IsOpen() bool

func (*IM) Name

func (im *IM) Name() string

type INode

type INode interface {
	fs.Node
	Dirent() fuse.Dirent
	IsDir() bool
	Activate() error
	Name() string
	INum() uint64
	Parent() *DirNode
}

type Node

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

func (*Node) INum

func (n *Node) INum() uint64

func (*Node) Init

func (n *Node) Init(parent *DirNode, name string, priv interface{}) error

func (*Node) Name

func (n *Node) Name() string

func (*Node) Parent

func (n *Node) Parent() *DirNode

type ProfInstance

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

func NewProf

func NewProf(memprof, cpuprof string) (p *ProfInstance, err error)

func (*ProfInstance) Start

func (p *ProfInstance) Start()

startProfiling enables memory and/or CPU profiling if the appropriate command line flags have been set.

func (*ProfInstance) Stop

func (p *ProfInstance) Stop()

type Room

type Room interface {
	EventHandler
	Id() string
	Name() string
	IsOpen() bool
	BaseChannel() *slack.BaseChannel
}

type RoomSet

type RoomSet struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewRoomSet

func NewRoomSet(name string, conn *FSConn, create DirCreator, rooms []Room) (*RoomSet, error)

func (*RoomSet) Event

func (rs *RoomSet) Event(evt slack.SlackEvent) bool

func (*RoomSet) Open

func (rs *RoomSet) Open(evt *slack.ChannelInfoEvent) bool

type Self

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

func NewSelf

func NewSelf(conn *FSConn, user *slack.UserDetails, team *slack.Team) (*Self, error)

type Sequence

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

func (*Sequence) Close

func (s *Sequence) Close()

func (*Sequence) Init

func (s *Sequence) Init()

func (*Sequence) Next

func (s *Sequence) Next() uint64

type Session

type Session struct {
	sync.Cond
	// contains filtered or unexported fields
}

func (*Session) Bytes

func (s *Session) Bytes(offset int64, size int) ([]byte, error)

func (*Session) CurrLen

func (s *Session) CurrLen() uint64

func (*Session) Event

func (s *Session) Event(evt slack.SlackEvent) bool

func (*Session) FetchHistory

func (s *Session) FetchHistory(hp slack.HistoryParameters) error

func (*Session) Init

func (s *Session) Init(room Room, conn *FSConn, history HistoryFn)

func (*Session) Write

func (s *Session) Write(msg []byte) error

type SessionAttrNode

type SessionAttrNode struct {
	Node
	Size int
}

func (*SessionAttrNode) Activate

func (an *SessionAttrNode) Activate() error

func (*SessionAttrNode) Attr

func (an *SessionAttrNode) Attr(a *fuse.Attr)

func (*SessionAttrNode) Dirent

func (n *SessionAttrNode) Dirent() fuse.Dirent

func (*SessionAttrNode) Getattr

func (*SessionAttrNode) IsDir

func (an *SessionAttrNode) IsDir() bool

func (*SessionAttrNode) Read

type SessionProvider

type SessionProvider interface {
	CurrLen() uint64
	Bytes(offset int64, size int) ([]byte, error)
}

type SessionWriter

type SessionWriter interface {
	Write([]byte) error
}

type Super

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

func NewSuper

func NewSuper() *Super

func (*Super) GetRoot

func (s *Super) GetRoot() *DirNode

func (*Super) Init

func (s *Super) Init()

func (*Super) NextInodeNum

func (s *Super) NextInodeNum() uint64

func (*Super) Root

func (s *Super) Root() (fs.Node, error)

type SymlinkNode

type SymlinkNode struct {
	Node
	// contains filtered or unexported fields
}

func NewSymlinkNode

func NewSymlinkNode(parent *DirNode, name string, target INode) (*SymlinkNode, error)

func (*SymlinkNode) Activate

func (sn *SymlinkNode) Activate() error

func (*SymlinkNode) Attr

func (sn *SymlinkNode) Attr(a *fuse.Attr)

func (*SymlinkNode) Dirent

func (n *SymlinkNode) Dirent() fuse.Dirent

func (*SymlinkNode) IsDir

func (sn *SymlinkNode) IsDir() bool
func (sn *SymlinkNode) Readlink(ctx context.Context, req *fuse.ReadlinkRequest) (string, error)

type Team

type Team struct {
	slack.Team
	// contains filtered or unexported fields
}

func NewTeam

func NewTeam(st *slack.Team, conn *FSConn) *Team

type Updater

type Updater interface {
	Update()
}

type User

type User struct {
	slack.User
	// contains filtered or unexported fields
}

func NewUser

func NewUser(su slack.User, conn *FSConn) *User

type UserSet

type UserSet struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewUserSet

func NewUserSet(name string, conn *FSConn, create DirCreator, users []*User) (*UserSet, error)

func (*UserSet) Event

func (us *UserSet) Event(evt slack.SlackEvent) bool

on change, lock UserSet, then lock User. No need to lock DirNode, as it doesn't change (we're not adding/removing child attributes). Updates to Attributes are done through atomic ops.

func (*UserSet) Get

func (us *UserSet) Get(id string) *User

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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