activity

package
v0.0.0-...-b9360c4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "activity"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [2]string{"station", "project"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func MakeBadRequest

func MakeBadRequest(err error) *goa.ServiceError

MakeBadRequest builds a goa.ServiceError from an error.

func MakeForbidden

func MakeForbidden(err error) *goa.ServiceError

MakeForbidden builds a goa.ServiceError from an error.

func MakeNotFound

func MakeNotFound(err error) *goa.ServiceError

MakeNotFound builds a goa.ServiceError from an error.

func MakeUnauthorized

func MakeUnauthorized(err error) *goa.ServiceError

MakeUnauthorized builds a goa.ServiceError from an error.

func NewProjectEndpoint

func NewProjectEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewProjectEndpoint returns an endpoint function that calls the method "project" of service "activity".

func NewStationEndpoint

func NewStationEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewStationEndpoint returns an endpoint function that calls the method "station" of service "activity".

func NewViewedProjectActivityPage

func NewViewedProjectActivityPage(res *ProjectActivityPage, view string) *activityviews.ProjectActivityPage

NewViewedProjectActivityPage initializes viewed result type ProjectActivityPage from result type ProjectActivityPage using the given view.

func NewViewedStationActivityPage

func NewViewedStationActivityPage(res *StationActivityPage, view string) *activityviews.StationActivityPage

NewViewedStationActivityPage initializes viewed result type StationActivityPage from result type StationActivityPage using the given view.

Types

type ActivityEntry

type ActivityEntry struct {
	ID        int64
	Key       string
	Project   *ProjectSummary
	Station   *StationSummary
	CreatedAt int64
	Type      string
	Meta      interface{}
}

type ActivityEntryCollection

type ActivityEntryCollection []*ActivityEntry

type Auther

type Auther interface {
	// JWTAuth implements the authorization logic for the JWT security scheme.
	JWTAuth(ctx context.Context, token string, schema *security.JWTScheme) (context.Context, error)
}

Auther defines the authorization functions to be implemented by the service.

type Client

type Client struct {
	StationEndpoint goa.Endpoint
	ProjectEndpoint goa.Endpoint
}

Client is the "activity" service client.

func NewClient

func NewClient(station, project goa.Endpoint) *Client

NewClient initializes a "activity" service client given the endpoints.

func (*Client) Project

func (c *Client) Project(ctx context.Context, p *ProjectPayload) (res *ProjectActivityPage, err error)

Project calls the "project" endpoint of the "activity" service.

func (*Client) Station

func (c *Client) Station(ctx context.Context, p *StationPayload) (res *StationActivityPage, err error)

Station calls the "station" endpoint of the "activity" service.

type Endpoints

type Endpoints struct {
	Station goa.Endpoint
	Project goa.Endpoint
}

Endpoints wraps the "activity" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "activity" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "activity" service endpoints.

type ProjectActivityPage

type ProjectActivityPage struct {
	Activities ActivityEntryCollection
	Total      int32
	Page       int32
}

ProjectActivityPage is the result type of the activity service project method.

func NewProjectActivityPage

func NewProjectActivityPage(vres *activityviews.ProjectActivityPage) *ProjectActivityPage

NewProjectActivityPage initializes result type ProjectActivityPage from viewed result type ProjectActivityPage.

type ProjectPayload

type ProjectPayload struct {
	Auth *string
	ID   int64
	Page *int64
}

ProjectPayload is the payload type of the activity service project method.

type ProjectSummary

type ProjectSummary struct {
	ID   int64
	Name string
}

type Service

type Service interface {
	// Station implements station.
	Station(context.Context, *StationPayload) (res *StationActivityPage, err error)
	// Project implements project.
	Project(context.Context, *ProjectPayload) (res *ProjectActivityPage, err error)
}

Service is the activity service interface.

type StationActivityPage

type StationActivityPage struct {
	Activities ActivityEntryCollection
	Total      int32
	Page       int32
}

StationActivityPage is the result type of the activity service station method.

func NewStationActivityPage

func NewStationActivityPage(vres *activityviews.StationActivityPage) *StationActivityPage

NewStationActivityPage initializes result type StationActivityPage from viewed result type StationActivityPage.

type StationPayload

type StationPayload struct {
	Auth *string
	ID   int64
	Page *int64
}

StationPayload is the payload type of the activity service station method.

type StationSummary

type StationSummary struct {
	ID   int64
	Name string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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