activity

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package activity provides access to the club activity of the Buddy System.

Package activity provides access to the club activity of the Buddy System.

Index

Constants

View Source
const (
	FoundingEvent = iota
	Study
	Etc
)

Variables

View Source
var (
	FilePathPrefix = strings.Join([]string{home, "registry"}, "/")
)

Functions

func Delete

func Delete(id primitive.ObjectID) error

Delete deletes a club activity of id.

NOTE:

It is a privileged operation:

Only the club managers can access to this operation.

Types

type Activities

type Activities []Activity
func Search(query string, private bool) (activities Activities, err error)

Search returns search results with query.

NOTE:

If private, it is a privileged operation:

Only the club managers can access to this operation.

type Activity

type Activity struct {
	ID           primitive.ObjectID `json:"id" bson:"_id"`
	Title        string             `json:"title" bson:"title"`
	Start        int64              `json:"start,string" bson:"start"`
	End          int64              `json:"end,string" bson:"end"`
	Place        string             `json:"place" bson:"place"`
	Type         int                `json:"type" bson:"type"`
	Description  string             `json:"description" bson:"description"`
	Participants []string           `json:"participants" bson:"participants"`
	Private      bool               `json:"private" bson:"private"`
	Files        Files              `json:"files" bson:"files"`
}

Activity represents a club activity state.

func New

func New(title string, start, end int64, place, description string, typ int, participants []string, private bool) *Activity

New returns a new activity.

func (Activity) Create

func (a Activity) Create() (err error)

Create creates a new activity.

NOTE:

It is a privileged operation:

Only the club managers can access to this operation.

func (Activity) DeleteFile

func (a Activity) DeleteFile(filename string) error

DeleteFile deletes file of FILENAME from a.

NOTE:

It is a privileged operation:

Only the club managers can access to this operation.

func (Activity) Update

func (a Activity) Update() error

Update updates a to update.

NOTE:

It is a privileged operation:

Only the club managers can access to this operation.

func (Activity) Upload

func (a Activity) Upload(filename string) error

Upload saves file of FILENAME into a.

NOTE:

It is a privileged operation:

Only the club managers can access to this operation.

type File

type File string

File represents a file.

func NewFile

func NewFile(filename string) File

NewFile returns a new file.

func (File) Absolute

func (f File) Absolute() string

Absolute returns the absolute path of f.

func (File) Delete

func (f File) Delete() error

Delete deletes f.

type Files

type Files []File

Jump to

Keyboard shortcuts

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