config

package
v0.0.0-...-8ea42c6 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2016 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package config "classify" (:P) a plain cherry file. --

  • Copyright (C) 2015 by Rafael Santiago *
  • This is a free software. You can redistribute it and/or modify under
  • the terms of the GNU General Public License version 2. *

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CherryRooms

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

CherryRooms represents your cherry tree... I mean your cherry server.

func NewCherryRooms

func NewCherryRooms() *CherryRooms

NewCherryRooms creates a new server container.

func (*CherryRooms) AddAction

func (c *CherryRooms) AddAction(roomName, id, label, template string)

AddAction adds an action to the "memory".

func (*CherryRooms) AddImage

func (c *CherryRooms) AddImage(roomName, id, label, template, url string)

AddImage adds an image (data that represents an image) to the "memory".

func (*CherryRooms) AddPublicMessage

func (c *CherryRooms) AddPublicMessage(roomName, message string)

AddPublicMessage adds a public message to the pool of public messages that will be used for the room brief's composing.

func (*CherryRooms) AddRoom

func (c *CherryRooms) AddRoom(roomName string, listenPort int16) bool

AddRoom adds a room to the "memory".

func (*CherryRooms) AddTemplate

func (c *CherryRooms) AddTemplate(roomName, id, template string)

AddTemplate adds a template based on room name, ID.

func (*CherryRooms) AddToIgnoreList

func (c *CherryRooms) AddToIgnoreList(from, to, roomName string)

AddToIgnoreList add to the user context some user to be ignored.

func (*CherryRooms) AddUser

func (c *CherryRooms) AddUser(roomName, nickname, color string, kickout bool)

AddUser does what it is saying. BELIEVE or NOT!!!

func (*CherryRooms) DelFromIgnoreList

func (c *CherryRooms) DelFromIgnoreList(from, to, roomName string)

DelFromIgnoreList removes from the user context a previous ignored user.

func (*CherryRooms) DequeueMessage

func (c *CherryRooms) DequeueMessage(roomName string)

DequeueMessage removes from the queue the oldest user message.

func (*CherryRooms) EnqueueMessage

func (c *CherryRooms) EnqueueMessage(roomName, from, to, action, image, say, priv string)

EnqueueMessage adds to the queue an user message.

func (*CherryRooms) GetActionList

func (c *CherryRooms) GetActionList(roomName string) string

GetActionList returns a well-formatted "HTML combo" containing all actions.

func (*CherryRooms) GetAllUsersAlias

func (c *CherryRooms) GetAllUsersAlias(roomName string) string

GetAllUsersAlias returns the "all users" alias.

func (*CherryRooms) GetBannerTemplate

func (c *CherryRooms) GetBannerTemplate(roomName string) string

GetBannerTemplate spits the banner template data.

func (*CherryRooms) GetBodyTemplate

func (c *CherryRooms) GetBodyTemplate(roomName string) string

GetBodyTemplate spits the body template data.

func (*CherryRooms) GetBriefTemplate

func (c *CherryRooms) GetBriefTemplate(roomName string) string

GetBriefTemplate spits the brief template data.

func (*CherryRooms) GetCertificatePath

func (c *CherryRooms) GetCertificatePath() string

GetCertificatePath spits the certificate path.

func (*CherryRooms) GetColor

func (c *CherryRooms) GetColor(from, roomName string) string

GetColor returns the user's nickname color.

func (*CherryRooms) GetDeIgnoreAction

func (c *CherryRooms) GetDeIgnoreAction(roomName string) string

GetDeIgnoreAction returns the action that represents the "deignoring".

func (*CherryRooms) GetEntranceTemplate

func (c *CherryRooms) GetEntranceTemplate(roomName string) string

GetEntranceTemplate spits the entrance template data.

func (*CherryRooms) GetExitMessage

func (c *CherryRooms) GetExitMessage(roomName string) string

GetExitMessage returns the pre-configurated exit message.

func (*CherryRooms) GetExitTemplate

func (c *CherryRooms) GetExitTemplate(roomName string) string

GetExitTemplate spits the exit template data.

func (*CherryRooms) GetFindBotTemplate

func (c *CherryRooms) GetFindBotTemplate(roomName string) string

GetFindBotTemplate spits the find bot template data.

func (*CherryRooms) GetFindResultsBodyTemplate

func (c *CherryRooms) GetFindResultsBodyTemplate(roomName string) string

GetFindResultsBodyTemplate spits the find template data (BODY).

func (*CherryRooms) GetFindResultsHeadTemplate

func (c *CherryRooms) GetFindResultsHeadTemplate(roomName string) string

GetFindResultsHeadTemplate spits the find template data (HEAD).

func (*CherryRooms) GetFindResultsTailTemplate

func (c *CherryRooms) GetFindResultsTailTemplate(roomName string) string

GetFindResultsTailTemplate spits the find template data (TAIL).

func (*CherryRooms) GetGreetingMessage

func (c *CherryRooms) GetGreetingMessage(roomName string) string

GetGreetingMessage returns the pre-configurated greeting message.

func (*CherryRooms) GetHighlightTemplate

func (c *CherryRooms) GetHighlightTemplate(roomName string) string

GetHighlightTemplate spits the highlight template data.

func (*CherryRooms) GetIgnoreAction

func (c *CherryRooms) GetIgnoreAction(roomName string) string

GetIgnoreAction returns the action that represents the ignoring.

func (*CherryRooms) GetIgnoreList

func (c *CherryRooms) GetIgnoreList(from, roomName string) string

GetIgnoreList returns all users ignored by an user.

func (*CherryRooms) GetImageList

func (c *CherryRooms) GetImageList(roomName string) string

GetImageList returns a well-formatted "HTML combo" containing all images.

func (*CherryRooms) GetJoinMessage

func (c *CherryRooms) GetJoinMessage(roomName string) string

GetJoinMessage returns the pre-configurated join message.

func (*CherryRooms) GetLastPublicMessages

func (c *CherryRooms) GetLastPublicMessages(roomName string) string

GetLastPublicMessages spits the last public messages (well-formatted in HTML).

func (*CherryRooms) GetListenPort

func (c *CherryRooms) GetListenPort(roomName string) string

GetListenPort returns the port that is being used for the room serving.

func (*CherryRooms) GetMaxUsers

func (c *CherryRooms) GetMaxUsers(roomName string) string

GetMaxUsers returns the total of users allowed in a room.

func (*CherryRooms) GetNextMessage

func (c *CherryRooms) GetNextMessage(roomName string) Message

GetNextMessage returns the next message that should be processed.

func (*CherryRooms) GetNickclashTemplate

func (c *CherryRooms) GetNickclashTemplate(roomName string) string

GetNickclashTemplate spits the nickclash template data.

func (*CherryRooms) GetOnDeIgnoreMessage

func (c *CherryRooms) GetOnDeIgnoreMessage(roomName string) string

GetOnDeIgnoreMessage returns the pre-configurated "on deignore" message.

func (*CherryRooms) GetOnIgnoreMessage

func (c *CherryRooms) GetOnIgnoreMessage(roomName string) string

GetOnIgnoreMessage returns the pre-configurated "on ignore" message.

func (*CherryRooms) GetPrivateKeyPath

func (c *CherryRooms) GetPrivateKeyPath() string

GetPrivateKeyPath spits the private key path.

func (*CherryRooms) GetPrivateMessageMarker

func (c *CherryRooms) GetPrivateMessageMarker(roomName string) string

GetPrivateMessageMarker returns the private message marker.

func (*CherryRooms) GetPublicDirectory

func (c *CherryRooms) GetPublicDirectory(roomName string) string

GetPublicDirectory spits the room's public directory.

func (*CherryRooms) GetRoomActionLabel

func (c *CherryRooms) GetRoomActionLabel(roomName, action string) string

GetRoomActionLabel spits a room action label.

func (*CherryRooms) GetRoomActionTemplate

func (c *CherryRooms) GetRoomActionTemplate(roomName, action string) string

GetRoomActionTemplate returns the template data from an action.

func (*CherryRooms) GetRoomByPort

func (c *CherryRooms) GetRoomByPort(port int16) *RoomConfig

GetRoomByPort returns a room (all configuration from it) given a port.

func (*CherryRooms) GetRoomUsers

func (c *CherryRooms) GetRoomUsers(roomName string) []string

GetRoomUsers spits all users connected in the specified room.

func (*CherryRooms) GetRooms

func (c *CherryRooms) GetRooms() []string

GetRooms spits all opened rooms.

func (*CherryRooms) GetServerName

func (c *CherryRooms) GetServerName() string

GetServerName spits the server name.

func (*CherryRooms) GetServername

func (c *CherryRooms) GetServername() string

GetServername spits the server name.

func (*CherryRooms) GetSessionID

func (c *CherryRooms) GetSessionID(from, roomName string) string

GetSessionID returns the user's session ID.

func (*CherryRooms) GetSkeletonTemplate

func (c *CherryRooms) GetSkeletonTemplate(roomName string) string

GetSkeletonTemplate spits the skeleton template data.

func (*CherryRooms) GetTopTemplate

func (c *CherryRooms) GetTopTemplate(roomName string) string

GetTopTemplate spits the top template data.

func (*CherryRooms) GetUserConnection

func (c *CherryRooms) GetUserConnection(roomName, user string) net.Conn

GetUserConnection returns the net.Conn that represents an "user peer".

func (*CherryRooms) GetUsersList

func (c *CherryRooms) GetUsersList(roomName string) string

GetUsersList returns a well-formatted "HTML combo" containing all users connected on a room.

func (*CherryRooms) GetUsersTotal

func (c *CherryRooms) GetUsersTotal(roomName string) string

GetUsersTotal returns the total of users currently talking in a room.

func (*CherryRooms) HasAction

func (c *CherryRooms) HasAction(roomName, id string) bool

HasAction verifies if an action really exists for the indicated room.

func (*CherryRooms) HasImage

func (c *CherryRooms) HasImage(roomName, id string) bool

HasImage verifies if an image really exists for the indicated room.

func (*CherryRooms) HasRoom

func (c *CherryRooms) HasRoom(roomName string) bool

HasRoom verifies if a room really exists in this server.

func (*CherryRooms) HasTemplate

func (c *CherryRooms) HasTemplate(roomName, id string) bool

HasTemplate verifies if a template really exists for a room.

func (*CherryRooms) HasUser

func (c *CherryRooms) HasUser(roomName, user string) bool

HasUser verifies if the user is connected in the room.

func (*CherryRooms) IsAllowingBriefs

func (c *CherryRooms) IsAllowingBriefs(roomName string) bool

IsAllowingBriefs verifies if briefs are allowed for a room.

func (*CherryRooms) IsIgnored

func (c *CherryRooms) IsIgnored(from, to, roomName string) bool

IsIgnored returns "true" if the user U is ignoring the asshole A, otherwise guess what.

func (*CherryRooms) IsValidUserRequest

func (c *CherryRooms) IsValidUserRequest(roomName, user, id string, userConn net.Conn) bool

IsValidUserRequest verifies if the session ID really matches with the previously defined.

func (*CherryRooms) Lock

func (c *CherryRooms) Lock(roomName string)

Lock acquire the room mutex.

func (*CherryRooms) PortBusyByAnotherRoom

func (c *CherryRooms) PortBusyByAnotherRoom(port int16) bool

PortBusyByAnotherRoom verifies if there is some port clash between rooms.

func (*CherryRooms) RemoveUser

func (c *CherryRooms) RemoveUser(roomName, nickname string)

RemoveUser removes a user...

func (*CherryRooms) SetAllUsersAlias

func (c *CherryRooms) SetAllUsersAlias(roomName, alias string)

SetAllUsersAlias sets all users alias.

func (*CherryRooms) SetAllowBrief

func (c *CherryRooms) SetAllowBrief(roomName string, value bool)

SetAllowBrief sets the allow brief option.

func (*CherryRooms) SetCertificatePath

func (c *CherryRooms) SetCertificatePath(strPath string)

SetCertificatePath sets the certificate path.

func (*CherryRooms) SetDeIgnoreAction

func (c *CherryRooms) SetDeIgnoreAction(roomName, action string)

SetDeIgnoreAction sets the action that will be used for "deignoring".

func (*CherryRooms) SetExitMessage

func (c *CherryRooms) SetExitMessage(roomName, message string)

SetExitMessage sets the exit message.

func (*CherryRooms) SetGreetingMessage

func (c *CherryRooms) SetGreetingMessage(roomName, message string)

SetGreetingMessage sets the greeting message.

func (*CherryRooms) SetIgnoreAction

func (c *CherryRooms) SetIgnoreAction(roomName, action string)

SetIgnoreAction sets the action that will be used for ignoring.

func (*CherryRooms) SetJoinMessage

func (c *CherryRooms) SetJoinMessage(roomName, message string)

SetJoinMessage sets the join message.

func (*CherryRooms) SetMaxUsers

func (c *CherryRooms) SetMaxUsers(roomName string, value int)

SetMaxUsers sets the maximum of users allowed in a room.

func (*CherryRooms) SetOnDeIgnoreMessage

func (c *CherryRooms) SetOnDeIgnoreMessage(roomName, message string)

SetOnDeIgnoreMessage sets the "on deignore" message.

func (*CherryRooms) SetOnIgnoreMessage

func (c *CherryRooms) SetOnIgnoreMessage(roomName, message string)

SetOnIgnoreMessage sets the "on ignore" message.

func (*CherryRooms) SetPrivateKeyPath

func (c *CherryRooms) SetPrivateKeyPath(strPath string)

SetPrivateKeyPath sets the private key path.

func (*CherryRooms) SetPrivateMessageMarker

func (c *CherryRooms) SetPrivateMessageMarker(roomName, marker string)

SetPrivateMessageMarker sets the private message marker.

func (*CherryRooms) SetPublicDirectory

func (c *CherryRooms) SetPublicDirectory(roomName, value string)

SetPublicDirectory sets the public directory for a room.

func (*CherryRooms) SetServername

func (c *CherryRooms) SetServername(servername string)

SetServername sets the server name.

func (*CherryRooms) SetUserConnection

func (c *CherryRooms) SetUserConnection(roomName, user string, conn net.Conn)

SetUserConnection registers a connection for a user recently enrolled in a room.

func (*CherryRooms) Unlock

func (c *CherryRooms) Unlock(roomName string)

Unlock dispose the room mutex.

type Message

type Message struct {
	From   string
	To     string
	Action string
	//    Sound string
	Image string
	Say   string
	Priv  string
}

Message gathers a message that must be formatted and delivered.

type RoomAction

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

RoomAction gathers the label and the template (data) from an action.

type RoomConfig

type RoomConfig struct {
	MainPeer net.Listener
	// contains filtered or unexported fields
}

RoomConfig represents in memory a defined room loaded from a cherry file.

type RoomMediaResource

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

RoomMediaResource gathers the label, template (data) and uri from a generical resource (until now, images only).

type RoomMisc

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

RoomMisc gathers the misc options for a room.

type RoomUser

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

RoomUser is the user context.

Directories

Path Synopsis
Package parser parse and loads a cherry file to the memory.
Package parser parse and loads a cherry file to the memory.

Jump to

Keyboard shortcuts

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