common

package
v0.0.0-...-e43fd8c Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrganization

func CreateOrganization(
	ctx context.Context,
	w http.ResponseWriter,
	r *http.Request,
	p httpr.Params)
func CreateOrganizationJoinLink(
	ctx context.Context,
	w http.ResponseWriter,
	r *http.Request,
	p httpr.Params)

create a new organization join link. only an administrator of an organization can execute this action

func DeleteOrganizationJoinLink(
	ctx context.Context,
	w http.ResponseWriter,
	r *http.Request,
	p httpr.Params)

delete an existing link same as previously

func ExpelUserFromOrganization

func ExpelUserFromOrganization(
	ctx context.Context,
	w http.ResponseWriter,
	r *http.Request,
	p httpr.Params,
)

expel an user from an organization, you can only do this if you are admin of the organization from where you want to expel someone

func GetOrganizationJoinLink(
	ctx context.Context,
	w http.ResponseWriter,
	r *http.Request,
	p httpr.Params)

by id get an existing link in order to consult the time left for the join link, or delete it, or get the the organizastion link for invited users to display orgs infos

func GetOrganizationJoinLinkByOrganizationId

func GetOrganizationJoinLinkByOrganizationId(
	ctx context.Context,
	w http.ResponseWriter,
	r *http.Request,
	p httpr.Params)

get join link for a given organization will work only for an admin in order to manage this join-link

func GetUser

func GetUser(ctx context.Context, w http.ResponseWriter, r *http.Request, p httpr.Params)

func GithubAuth

func GithubAuth(w http.ResponseWriter, r *http.Request, p httpr.Params)

func GrantAdminRightToUser

func GrantAdminRightToUser(
	ctx context.Context,
	w http.ResponseWriter,
	r *http.Request,
	p httpr.Params,
)

func Init

func Init(
	client_ *elastic.Client,
	analyticsClient_ *ga.Client,
	ep_ *endpoints.Endpoints,
	db_ *gorm.DB,
	githubClientId_ string,
)

func JoinOrganization

func JoinOrganization(
	ctx context.Context,
	w http.ResponseWriter,
	r *http.Request,
	p httpr.Params)

join an organization. if join link is not expired.

func LeaveOrganization

func LeaveOrganization(
	ctx context.Context,
	w http.ResponseWriter,
	r *http.Request,
	p httpr.Params,
)

leave an organization, you cannot leave an organization if you are the only admin for it

func ListUserOrganizations

func ListUserOrganizations(
	ctx context.Context,
	w http.ResponseWriter,
	r *http.Request,
	p httpr.Params)

list user organization

func ReadJsonBody

func ReadJsonBody(r *http.Request, expectedBody interface{}) error

func RedirectGithubAuthorize

func RedirectGithubAuthorize(w http.ResponseWriter, r *http.Request, p httpr.Params)

just redirect the user with the url to the github oauth login with the client_id setted in the backend

func SlackCommand

func SlackCommand(w http.ResponseWriter, r *http.Request, p httpr.Params)

func WriteJsonResponse

func WriteJsonResponse(w http.ResponseWriter, status int, body interface{})

func WriteResponse

func WriteResponse(w http.ResponseWriter, status int, body string)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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